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 list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Roles [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Service.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Service.java new file mode 100644 index 000000000..b4c85a8f5 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Service.java @@ -0,0 +1,76 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("OS-KSADM:service") +public class Service implements Serializable { + + private String id; + + private String type; + + private String name; + + private String description; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @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 "Service [id=" + id + ", type=" + type + ", name=" + name + + ", description=" + description + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Services.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Services.java new file mode 100644 index 000000000..8596ad34f --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Services.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 Services implements Iterable, Serializable { + + @JsonProperty("OS-KSADM:services") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Services [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenant.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenant.java new file mode 100644 index 000000000..1498082da --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenant.java @@ -0,0 +1,102 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("tenant") +@JsonIgnoreProperties(ignoreUnknown=true) +public class Tenant implements Serializable { + + private String id; + + private String name; + + private String description; + + private Boolean enabled; + + public Tenant(String name, String description, Boolean enabled) { + this.name = name; + this.description = description; + this.enabled = enabled; + } + + public Tenant(String name, String description) { + this(name, description, Boolean.TRUE); + } + + public Tenant(String name) { + this(name, null); + } + + public Tenant() { + } + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = 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 Boolean getEnabled() { + return enabled; + } + + /** + * @param enabled the enabled to set + */ + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Tenant [id=" + id + ", name=" + name + ", description=" + + description + ", enabled=" + enabled + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenants.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenants.java new file mode 100644 index 000000000..3af7c3486 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenants.java @@ -0,0 +1,44 @@ +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 Tenants implements Iterable, Serializable { + + @JsonProperty("tenants") + private List list; + + @JsonProperty("tenants_links") + private List links; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Tenants [list=" + list + ", links=" + links + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Token.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Token.java new file mode 100644 index 000000000..934387bcd --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Token.java @@ -0,0 +1,55 @@ +package com.woorea.openstack.keystone.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import java.util.Calendar; + +@JsonIgnoreProperties(ignoreUnknown=true) +public final class Token { + + private String id; + + private Calendar issued_at; + + private Calendar expires; + + private Tenant tenant; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the issued_at + */ + public Calendar getIssued_at() { + return issued_at; + } + + /** + * @return the expires + */ + public Calendar getExpires() { + return expires; + } + + /** + * @return the tenant + */ + public Tenant getTenant() { + return tenant; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Token [id=" + id + ", Issued_at=" + issued_at + ", expires=" + expires + ", tenant=" + + tenant + "]"; + } + +} \ No newline at end of file diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/User.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/User.java new file mode 100644 index 000000000..cce8cfb27 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/User.java @@ -0,0 +1,134 @@ +package com.woorea.openstack.keystone.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("user") +public class User implements Serializable { + + private String id; + + private String username; + + @JsonProperty("OS-KSADM:password") + private String password; + + private String tenantId; + + private String name; + + private String email; + + private Boolean enabled; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the username + */ + public String getUsername() { + return username; + } + + /** + * @param username the username to set + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * @return the password + */ + public String getPassword() { + return password; + } + + /** + * @param password the password to set + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @param tenantId the tenantId to set + */ + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * @param email the email to set + */ + public void setEmail(String email) { + this.email = email; + } + + /** + * @return the enabled + */ + public Boolean getEnabled() { + return enabled; + } + + /** + * @param enabled the enabled to set + */ + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "User [id=" + id + ", username=" + username + ", password=" + + password + ", tenantId=" + tenantId + ", name=" + name + + ", email=" + email + ", enabled=" + enabled + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Users.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Users.java new file mode 100644 index 000000000..772b0050a --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Users.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 Users implements Iterable, Serializable { + + @JsonProperty("users") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Users [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/AccessKey.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/AccessKey.java new file mode 100644 index 000000000..40e99822b --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/AccessKey.java @@ -0,0 +1,72 @@ +package com.woorea.openstack.keystone.model.authentication; + +import com.fasterxml.jackson.annotation.JsonRootName; + +import com.woorea.openstack.keystone.model.Authentication; + +@JsonRootName("auth") +public class AccessKey extends Authentication { + + public static final class ApiAccessKeyCredentials { + + private String accessKey; + + private String secretKey; + + /** + * @return the accessKey + */ + public String getAccessKey() { + return accessKey; + } + + /** + * @param accessKey the accessKey to set + */ + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + /** + * @return the secretKey + */ + public String getSecretKey() { + return secretKey; + } + + /** + * @param secretKey the secretKey to set + */ + public void setSecretKey(String secretKey) { + this.secretKey = secretKey; + } + + } + + private ApiAccessKeyCredentials apiAccessKeyCredentials = new ApiAccessKeyCredentials(); + + public AccessKey() { + + } + + public AccessKey(String accessKey, String secretKey) { + apiAccessKeyCredentials.setAccessKey(accessKey); + apiAccessKeyCredentials.setSecretKey(secretKey); + } + + /** + * @return the apiAccessKeyCredentials + */ + public ApiAccessKeyCredentials getApiAccessKeyCredentials() { + return apiAccessKeyCredentials; + } + + /** + * @param apiAccessKeyCredentials the apiAccessKeyCredentials to set + */ + public void setApiAccessKeyCredentials( + ApiAccessKeyCredentials apiAccessKeyCredentials) { + this.apiAccessKeyCredentials = apiAccessKeyCredentials; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/TokenAuthentication.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/TokenAuthentication.java new file mode 100644 index 000000000..99ea64efb --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/TokenAuthentication.java @@ -0,0 +1,50 @@ +package com.woorea.openstack.keystone.model.authentication; + +import com.fasterxml.jackson.annotation.JsonRootName; + +import com.woorea.openstack.keystone.model.Authentication; + +@JsonRootName("auth") +public class TokenAuthentication extends Authentication { + + public static final class Token { + + private String id; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + } + + private Token token = new Token(); + + public TokenAuthentication(String token) { + this.token.id = token; + } + + /** + * @return the token + */ + public Token getToken() { + return token; + } + + /** + * @param token the token to set + */ + public void setToken(Token token) { + this.token = token; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/UsernamePassword.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/UsernamePassword.java new file mode 100644 index 000000000..69f7c6573 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/UsernamePassword.java @@ -0,0 +1,71 @@ +package com.woorea.openstack.keystone.model.authentication; + +import com.fasterxml.jackson.annotation.JsonRootName; + +import com.woorea.openstack.keystone.model.Authentication; + +@JsonRootName("auth") +public class UsernamePassword extends Authentication { + + public static final class PasswordCredentials { + + private String username; + + private String password; + + /** + * @return the username + */ + public String getUsername() { + return username; + } + + /** + * @param username the username to set + */ + public void setUsername(String username) { + this.username = username; + } + + /** + * @return the password + */ + public String getPassword() { + return password; + } + + /** + * @param password the password to set + */ + public void setPassword(String password) { + this.password = password; + } + + } + + private PasswordCredentials passwordCredentials = new PasswordCredentials(); + + public UsernamePassword() { + + } + + public UsernamePassword(String username, String password) { + passwordCredentials.setUsername(username); + passwordCredentials.setPassword(password); + } + + /** + * @return the passwordCredentials + */ + public PasswordCredentials getPasswordCredentials() { + return passwordCredentials; + } + + /** + * @param passwordCredentials the passwordCredentials to set + */ + public void setPasswordCredentials(PasswordCredentials passwordCredentials) { + this.passwordCredentials = passwordCredentials; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Authentication.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Authentication.java new file mode 100644 index 000000000..df5236383 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Authentication.java @@ -0,0 +1,284 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("auth") +public class Authentication implements Serializable { + + public static final class Identity { + + public static final Identity password(String userId, String password) { + Identity identity = new Identity(); + identity.getMethods().add("password"); + Password method = new Password(); + method.getUser().setId(userId); + method.getUser().setPassword(password); + identity.setPassword(method); + return identity; + } + + public static final Identity password(String domainName, String username, String password) { + Identity identity = new Identity(); + identity.getMethods().add("password"); + Password method = new Password(); + com.woorea.openstack.keystone.v3.model.Authentication.Identity.Password.User.Domain domain = new com.woorea.openstack.keystone.v3.model.Authentication.Identity.Password.User.Domain(); + domain.setName(domainName); + method.getUser().setDomain(domain); + method.getUser().setName(username); + method.getUser().setPassword(password); + identity.setPassword(method); + return identity; + } + + public static final Identity token(String token) { + Identity identity = new Identity(); + identity.getMethods().add("token"); + Token method = new Token(); + method.setId(token); + identity.setToken(method); + return identity; + } + + private List methods = new ArrayList(); + + public static final class Password { + + public static final class User { + + public static final class Domain { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + private Domain domain; + + private String id; + + private String name; + + private String password; + + public Domain getDomain() { + return domain; + } + + public void setDomain(Domain domain) { + this.domain = domain; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + } + + private User user = new User(); + + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + } + + private Password password; + + public static final class Token { + + private String id; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + } + + private Token token; + + public List getMethods() { + return methods; + } + + public void setMethods(List methods) { + this.methods = methods; + } + + public Password getPassword() { + return password; + } + + public void setPassword(Password password) { + this.password = password; + } + + public Token getToken() { + return token; + } + + public void setToken(Token token) { + this.token = token; + } + + } + + private Identity identity; + + public static final class Scope { + + public static Scope project(String id) { + Scope scope = new Scope(); + Project project = new Project(); + project.setId(id); + scope.setProject(project); + return scope; + } + + public static Scope project(String domainName, String projectName) { + Scope scope = new Scope(); + com.woorea.openstack.keystone.v3.model.Authentication.Scope.Project.Domain domain = new com.woorea.openstack.keystone.v3.model.Authentication.Scope.Project.Domain(); + domain.setName(domainName); + Project project = new Project(); + project.setDomain(domain); + project.setName(projectName); + scope.setProject(project); + return scope; + } + + public static final class Project { + + public static final class Domain { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } + + private String id; + + private Domain domain; + + private String name; + + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Domain getDomain() { + return domain; + } + + public void setDomain(Domain domain) { + this.domain = domain; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private Project project; + + public Project getProject() { + return project; + } + + public void setProject(Project project) { + this.project = project; + } + + } + + private Scope scope; + + public Identity getIdentity() { + return identity; + } + + public void setIdentity(Identity identity) { + this.identity = identity; + } + + public Scope getScope() { + return scope; + } + + public void setScope(Scope scope) { + this.scope = scope; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java new file mode 100644 index 000000000..a0c14ce67 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java @@ -0,0 +1,61 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("credential") +public class Credential { + + private String id; + + private String projectId; + + private String type; + + private String userId; + + private Map blob = new HashMap(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Map getBlob() { + return blob; + } + + public void setBlob(Map blob) { + this.blob = blob; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credentials.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credentials.java new file mode 100644 index 000000000..39ba56771 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credentials.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Credentials implements Iterable, Serializable { + + @JsonProperty("credentials") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Credentials [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domain.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domain.java new file mode 100644 index 000000000..875c4b63c --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domain.java @@ -0,0 +1,48 @@ +package com.woorea.openstack.keystone.v3.model; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("domain") +public class Domain { + + private String id; + + private String name; + + private String description; + + private Boolean enabled; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domains.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domains.java new file mode 100644 index 000000000..ee03fbc47 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domains.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Domains implements Iterable, Serializable { + + @JsonProperty("domains") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Domains [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoint.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoint.java new file mode 100644 index 000000000..08456bc1f --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoint.java @@ -0,0 +1,51 @@ +package com.woorea.openstack.keystone.v3.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("endpoint") +public class Endpoint { + + private String id; + + @JsonProperty("interface") + private String iface; + + private String name; + + @JsonProperty("service_id") + private String serviceId; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getInterface() { + return iface; + } + + public void setInterface(String iface) { + this.iface = iface; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getServiceId() { + return serviceId; + } + + public void setServiceId(String serviceId) { + this.serviceId = serviceId; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoints.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoints.java new file mode 100644 index 000000000..617db7edd --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoints.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.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/v3/model/Group.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Group.java new file mode 100644 index 000000000..7cd28ad7a --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Group.java @@ -0,0 +1,50 @@ +package com.woorea.openstack.keystone.v3.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("group") +public class Group { + + private String id; + + @JsonProperty("domain_id") + private String domainId; + + private String name; + + private String description; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Groups.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Groups.java new file mode 100644 index 000000000..4085636d2 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Groups.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Groups implements Iterable, Serializable { + + @JsonProperty("groups") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Groups [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policies.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policies.java new file mode 100644 index 000000000..25e10c106 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policies.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Policies implements Iterable, Serializable { + + @JsonProperty("policies") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Policies [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java new file mode 100644 index 000000000..d0ccde815 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java @@ -0,0 +1,61 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("policy") +public class Policy { + + private String id; + + private String projectId; + + private String type; + + private String userId; + + private Map blob = new HashMap(); + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public Map getBlob() { + return blob; + } + + public void setBlob(Map blob) { + this.blob = blob; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java new file mode 100644 index 000000000..cca3d73c1 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java @@ -0,0 +1,50 @@ +package com.woorea.openstack.keystone.v3.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("project") +public class Project { + + private String id; + + @JsonProperty("domain_id") + private String domainId; + + private String name; + + private Boolean enabled; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Projects.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Projects.java new file mode 100644 index 000000000..1826fb8b9 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Projects.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Projects implements Iterable, Serializable { + + @JsonProperty("projects") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Projects [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Role.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Role.java new file mode 100644 index 000000000..bd2933b1d --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Role.java @@ -0,0 +1,67 @@ +package com.woorea.openstack.keystone.v3.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/v3/model/Roles.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Roles.java new file mode 100644 index 000000000..92b688dc9 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Roles.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.keystone.v3.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 list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Roles [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Service.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Service.java new file mode 100644 index 000000000..6e123603b --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Service.java @@ -0,0 +1,48 @@ +package com.woorea.openstack.keystone.v3.model; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("service") +public class Service { + + private String id; + + private String type; + + private String name; + + private String description; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + 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 String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Services.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Services.java new file mode 100644 index 000000000..7066fe45a --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Services.java @@ -0,0 +1,36 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import com.woorea.openstack.keystone.model.Service; + +public class Services implements Iterable, Serializable { + + @JsonProperty("services") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Services [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Token.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Token.java new file mode 100644 index 000000000..3151adfcd --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Token.java @@ -0,0 +1,370 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("token") +@JsonIgnoreProperties(ignoreUnknown=true) +public class Token implements Serializable { + + private String id; + + @JsonProperty("expires_at") + private Calendar expiresAt; + + @JsonProperty("issued_at") + private Calendar issuedAt; + + private List methods; + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class Domain { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private Domain domain; + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class Project { + + private Domain domain; + + private String id; + + private String name; + + public Domain getDomain() { + return domain; + } + + public void setDomain(Domain domain) { + this.domain = domain; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private Project project; + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class User { + + @JsonIgnoreProperties(ignoreUnknown=true) + private static final class Domain { + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private String id; + + private String name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + + private User user; + + @JsonIgnoreProperties(ignoreUnknown=true) + public static final class Role { + + private String id; + + private String name; + + } + + private List roles; + + public static final class Service { + + public static final class Endpoint { + + private String id; + + private String url; + + private String region; + + private Boolean enabled; + + @JsonProperty("legacy_endpoint_id") + private String legacyEndpointId; + + @JsonProperty("interface") + private String iface; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getLegacyEndpointId() { + return legacyEndpointId; + } + + public void setLegacyEndpointId(String legacyEndpointId) { + this.legacyEndpointId = legacyEndpointId; + } + + public String getInterface() { + return iface; + } + + public void setInterface(String iface) { + this.iface = iface; + } + + } + + private String id; + + private String type; + + private List endpoints; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List getEndpoints() { + return endpoints; + } + + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + } + + private List catalog; + + + public String getId() { + return id; + } + + + + public void setId(String id) { + this.id = id; + } + + + + public Calendar getExpiresAt() { + return expiresAt; + } + + + + public void setExpiresAt(Calendar expiresAt) { + this.expiresAt = expiresAt; + } + + + + public Calendar getIssuedAt() { + return issuedAt; + } + + + + public void setIssuedAt(Calendar issuedAt) { + this.issuedAt = issuedAt; + } + + + + public List getMethods() { + return methods; + } + + + + public void setMethods(List methods) { + this.methods = methods; + } + + + + public Domain getDomain() { + return domain; + } + + + + public void setDomain(Domain domain) { + this.domain = domain; + } + + + + public Project getProject() { + return project; + } + + + + public void setProject(Project project) { + this.project = project; + } + + + + public User getUser() { + return user; + } + + + + public void setUser(User user) { + this.user = user; + } + + + + public List getRoles() { + return roles; + } + + + + public void setRoles(List roles) { + this.roles = roles; + } + + + + public List getCatalog() { + return catalog; + } + + + + public void setCatalog(List catalog) { + this.catalog = catalog; + } + + + @Override + public String toString() { + return "Token [id=" + id + ", expiresAt=" + expiresAt + ", issuedAt=" + + issuedAt + ", methods=" + methods + ", domain=" + domain + + ", project=" + project + ", user=" + user + ", roles=" + + roles + ", catalog=" + catalog + "]"; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/User.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/User.java new file mode 100644 index 000000000..ed68e16b5 --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/User.java @@ -0,0 +1,91 @@ +package com.woorea.openstack.keystone.v3.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("user") +public class User { + + private String id; + + @JsonProperty("domain_id") + private String domainId; + + @JsonProperty("default_project_id") + private String defaultProjectId; + + private String name; + + private String password; + + private String email; + + private String description; + + private Boolean enabled; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getDomainId() { + return domainId; + } + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + public String getDefaultProjectId() { + return defaultProjectId; + } + + public void setDefaultProjectId(String defaultProjectId) { + this.defaultProjectId = defaultProjectId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + +} diff --git a/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Users.java b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Users.java new file mode 100644 index 000000000..c7af1899b --- /dev/null +++ b/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Users.java @@ -0,0 +1,36 @@ +package com.woorea.openstack.keystone.v3.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import com.woorea.openstack.keystone.model.User; + +public class Users implements Iterable, Serializable { + + @JsonProperty("users") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Users [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/nova-client/pom.xml b/nova-client/pom.xml new file mode 100644 index 000000000..1338768e9 --- /dev/null +++ b/nova-client/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + nova-client + OpenStack Nova Client + OpenStack Nova Client + + + com.woorea + openstack-client + 3.2.10-SNAPSHOT + + + com.woorea + nova-model + 3.2.10-SNAPSHOT + + + \ No newline at end of file diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java b/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java new file mode 100644 index 000000000..0a0988356 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/Nova.java @@ -0,0 +1,129 @@ +package com.woorea.openstack.nova; + + +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackClientConnector; +import com.woorea.openstack.nova.api.ExtensionsResource; +import com.woorea.openstack.nova.api.FlavorsResource; +import com.woorea.openstack.nova.api.ImagesResource; +import com.woorea.openstack.nova.api.QuotaSetsResource; +import com.woorea.openstack.nova.api.ServersResource; +import com.woorea.openstack.nova.api.ServicesResource; +import com.woorea.openstack.nova.api.HypervisorsResource; +import com.woorea.openstack.nova.api.extensions.AggregatesExtension; +import com.woorea.openstack.nova.api.extensions.FloatingIpsExtension; +import com.woorea.openstack.nova.api.extensions.KeyPairsExtension; +import com.woorea.openstack.nova.api.extensions.SecurityGroupsExtension; +import com.woorea.openstack.nova.api.extensions.SnapshotsExtension; +import com.woorea.openstack.nova.api.extensions.VolumesExtension; +import com.woorea.openstack.nova.api.extensions.HostsExtension; + +public class Nova extends OpenStackClient { + + private final ExtensionsResource EXTENSIONS; + + private final ServersResource SERVERS; + + private final ImagesResource IMAGES; + + private final FlavorsResource FLAVORS; + + private final KeyPairsExtension KEY_PAIRS; + + private final FloatingIpsExtension FLOATING_IPS; + + private final SecurityGroupsExtension SECURITY_GROUPS; + + private final SnapshotsExtension SNAPSHOTS; + + private final VolumesExtension VOLUMES; + + private final AggregatesExtension AGGREGATES; + + private final QuotaSetsResource QUOTA_SETS; + + private final HostsExtension HOSTS; + + private final ServicesResource SERVICES; + + private final HypervisorsResource HYPERVISORS; + + public Nova(String endpoint, OpenStackClientConnector connector) { + super(endpoint, connector); + EXTENSIONS = new ExtensionsResource(this); + SERVERS = new ServersResource(this); + IMAGES = new ImagesResource(this); + FLAVORS = new FlavorsResource(this); + KEY_PAIRS = new KeyPairsExtension(this); + FLOATING_IPS = new FloatingIpsExtension(this); + SECURITY_GROUPS = new SecurityGroupsExtension(this); + SNAPSHOTS = new SnapshotsExtension(this); + VOLUMES = new VolumesExtension(this); + AGGREGATES = new AggregatesExtension(this); + QUOTA_SETS = new QuotaSetsResource(this); + HOSTS = new HostsExtension(this); + SERVICES = new ServicesResource(this); + HYPERVISORS = new HypervisorsResource(this); + } + + public Nova(String endpoint) { + this(endpoint, null); + } + + public ExtensionsResource extensions() { + return EXTENSIONS; + } + + public ServersResource servers() { + return SERVERS; + } + + public ImagesResource images() { + return IMAGES; + } + + public FlavorsResource flavors() { + return FLAVORS; + } + + public KeyPairsExtension keyPairs() { + return KEY_PAIRS; + } + + public FloatingIpsExtension floatingIps() { + return FLOATING_IPS; + } + + public SecurityGroupsExtension securityGroups() { + return SECURITY_GROUPS; + } + + public SnapshotsExtension snapshots() { + return SNAPSHOTS; + } + + public VolumesExtension volumes() { + return VOLUMES; + } + + public AggregatesExtension aggregates() { + return AGGREGATES; + } + + public QuotaSetsResource quotaSets() { + return QUOTA_SETS; + } + + public HostsExtension hosts() { + return HOSTS; + } + + public ServicesResource services() { + return SERVICES; + } + + public HypervisorsResource hypervisors() { + return HYPERVISORS; + } + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/ExtensionsResource.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/ExtensionsResource.java new file mode 100644 index 000000000..148ec40db --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/ExtensionsResource.java @@ -0,0 +1,30 @@ +package com.woorea.openstack.nova.api; + + +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.nova.model.Extensions; + +public class ExtensionsResource { + + private final OpenStackClient CLIENT; + + public ExtensionsResource(OpenStackClient client) { + CLIENT = client; + } + + public List list(boolean detail) { + return new List(detail); + } + + public class List extends OpenStackRequest { + + public List(boolean detail) { + super(CLIENT, HttpMethod.GET, detail ? buildPath("extensions", "detail") : buildPath("extensions"), null, Extensions.class); + } + + } + +} + diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/FlavorsResource.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/FlavorsResource.java new file mode 100644 index 000000000..c3e2256e0 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/FlavorsResource.java @@ -0,0 +1,85 @@ +package com.woorea.openstack.nova.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.nova.model.Flavor; +import com.woorea.openstack.nova.model.Flavors; +import com.woorea.openstack.nova.model.Metadata; + +public class FlavorsResource { + + private final OpenStackClient CLIENT; + + public FlavorsResource(OpenStackClient client) { + CLIENT = client; + } + + public List list(boolean detail) { + return new List(detail); + } + + public Create create(Flavor flavor) { + return new Create(flavor); + } + + 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 class List extends OpenStackRequest { + + public List(boolean detail) { + super(CLIENT, HttpMethod.GET, detail ? "/flavors/detail" : "/flavors", null, Flavors.class); + } + + } + + public class Create extends OpenStackRequest { + + private Flavor flavor; + + public Create(Flavor flavor) { + super(CLIENT, HttpMethod.POST, "/flavors", Entity.json(flavor), Flavor.class); + this.flavor = flavor; + } + + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/flavors/").append(id).toString(), null, Flavor.class); + } + + } + + public class ShowMetadata extends OpenStackRequest { + + public ShowMetadata(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/flavors/").append(id).append("/metadata").toString(), null, Metadata.class); + } + + } + + public class Delete extends OpenStackRequest { + + public Delete(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/flavors/").append(id).toString(), null, Void.class); + } + + } + +} + diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/HypervisorsResource.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/HypervisorsResource.java new file mode 100644 index 000000000..fe09d0e1d --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/HypervisorsResource.java @@ -0,0 +1,36 @@ +package com.woorea.openstack.nova.api; + +import java.util.HashMap; + +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.nova.model.Hypervisor; +import com.woorea.openstack.nova.model.Hypervisors; + +/** + * Model for HypervisorsResource + * + */ + +public class HypervisorsResource { + + private final OpenStackClient CLIENT; + + public HypervisorsResource(OpenStackClient client) { + this.CLIENT = client; + } + + public List list() { + return new List(); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, "/os-hypervisors", null, Hypervisors.class); + } + } + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/ImagesResource.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/ImagesResource.java new file mode 100644 index 000000000..780cb12ae --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/ImagesResource.java @@ -0,0 +1,85 @@ +package com.woorea.openstack.nova.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.nova.model.Image; +import com.woorea.openstack.nova.model.Images; +import com.woorea.openstack.nova.model.Metadata; + +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 ShowMetadata showMetadata(String id) { + return new ShowMetadata(id); + } + + + public Delete delete(String id) { + return new Delete(id); + } + + 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 { + + private Image image; + + public Create(Image image) { + super(CLIENT, HttpMethod.POST, "/images", Entity.json(image), Image.class); + this.image = image; + } + + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/images/").append(id).toString(), null, Image.class); + } + + } + + public class ShowMetadata extends OpenStackRequest { + + public ShowMetadata(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/images/").append(id).append("/metadata").toString(), null, Metadata.class); + } + + } + + public class Delete extends OpenStackRequest { + + public Delete(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/images/").append(id).toString(), null, Void.class); + } + + } + +} + diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/QuotaSetsResource.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/QuotaSetsResource.java new file mode 100644 index 000000000..166fb42e3 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/QuotaSetsResource.java @@ -0,0 +1,61 @@ +package com.woorea.openstack.nova.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.nova.model.Limits; +import com.woorea.openstack.nova.model.QuotaSet; +import com.woorea.openstack.nova.model.SimpleTenantUsage; + +public class QuotaSetsResource { + + private final OpenStackClient CLIENT; + + public QuotaSetsResource(OpenStackClient client) { + CLIENT = client; + } + + public ShowQuota showQuota(String tenantId) { + return new ShowQuota(tenantId); + } + + public UpdateQuota updateQuota(String tenantId, QuotaSet quotaSet) { + return new UpdateQuota(tenantId, quotaSet); + } + + public ShowUsage showUsage(String tenantId) { + return new ShowUsage(tenantId); + } + + public ShowUsedLimits showUsedLimits() { + return new ShowUsedLimits(); + } + + public class ShowQuota extends OpenStackRequest { + public ShowQuota(String tenantId) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-quota-sets/").append(tenantId), null, QuotaSet.class); + } + + } + + public class UpdateQuota extends OpenStackRequest { + public UpdateQuota(String tenantId, QuotaSet quotaSet) { + super(CLIENT, HttpMethod.PUT, new StringBuilder("/os-quota-sets/").append(tenantId), Entity.json(quotaSet), QuotaSet.class); + } + } + + public class ShowUsage extends OpenStackRequest { + public ShowUsage(String tenantId) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-simple-tenant-usage/").append(tenantId), null, SimpleTenantUsage.class); + } + } + + public class ShowUsedLimits extends OpenStackRequest { + public ShowUsedLimits() { + super(CLIENT, HttpMethod.GET, new StringBuilder("/limits"), null, Limits.class); + } + } +} + diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/ServersResource.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/ServersResource.java new file mode 100644 index 000000000..2abf392c0 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/ServersResource.java @@ -0,0 +1,541 @@ +package com.woorea.openstack.nova.api; + + +import java.util.Map; + +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.nova.model.Metadata; +import com.woorea.openstack.nova.model.Server; +import com.woorea.openstack.nova.model.Server.Addresses; +import com.woorea.openstack.nova.model.ServerAction.ChangePassword; +import com.woorea.openstack.nova.model.ServerAction.ConfirmResize; +import com.woorea.openstack.nova.model.ServerAction.ConsoleOutput; +import com.woorea.openstack.nova.model.ServerAction.CreateBackup; +import com.woorea.openstack.nova.model.ServerAction.CreateImage; +import com.woorea.openstack.nova.model.ServerAction.GetConsoleOutput; +import com.woorea.openstack.nova.model.ServerAction.GetVncConsole; +import com.woorea.openstack.nova.model.ServerAction.Lock; +import com.woorea.openstack.nova.model.ServerAction.Pause; +import com.woorea.openstack.nova.model.ServerAction.Reboot; +import com.woorea.openstack.nova.model.ServerAction.Rebuild; +import com.woorea.openstack.nova.model.ServerAction.Rescue; +import com.woorea.openstack.nova.model.ServerAction.Resize; +import com.woorea.openstack.nova.model.ServerAction.Resume; +import com.woorea.openstack.nova.model.ServerAction.RevertResize; +import com.woorea.openstack.nova.model.ServerAction.Start; +import com.woorea.openstack.nova.model.ServerAction.Stop; +import com.woorea.openstack.nova.model.ServerAction.Suspend; +import com.woorea.openstack.nova.model.ServerAction.Unlock; +import com.woorea.openstack.nova.model.ServerAction.Unpause; +import com.woorea.openstack.nova.model.ServerAction.Unrescue; +import com.woorea.openstack.nova.model.ServerAction.VncConsole; +import com.woorea.openstack.nova.model.ServerForCreate; +import com.woorea.openstack.nova.model.Servers; +import com.woorea.openstack.nova.model.VolumeAttachment; +import com.woorea.openstack.nova.model.VolumeAttachments; + +public class ServersResource { + + private final OpenStackClient CLIENT; + + public ServersResource(OpenStackClient client) { + CLIENT = client; + } + + public List list(boolean detail) { + return new List(detail); + } + + public Boot boot(ServerForCreate server) { + return new Boot(server); + } + + public Show show(String id) { + return new Show(id); + } + + public ShowMetadata showMetadata(String id) { + return new ShowMetadata(id); + } + + public CreateOrUpdateMetadata createOrUpdateMetadata(String id,Metadata metadata) { + return new CreateOrUpdateMetadata(id,metadata); + } + + public ReplaceMetadata replaceMetadata(String id,Metadata metadata) { + return new ReplaceMetadata(id,metadata); + } + public DeleteMetadata deleteMetadata(String id, String key) { + return new DeleteMetadata(id,key); + } + + public Delete delete(String id) { + return new Delete(id); + } + + public class List extends OpenStackRequest { + + public List(boolean detail) { + super(CLIENT, HttpMethod.GET, detail ? "/servers/detail" : "/servers", null, Servers.class); + } + + } + + public class Boot extends OpenStackRequest { + + private ServerForCreate server; + + public Boot(ServerForCreate server) { + super(CLIENT, HttpMethod.POST, "/servers", Entity.json(server), Server.class); + this.server = server; + } + + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/servers/").append(id), null, Server.class); + } + + } + + public class ShowMetadata extends OpenStackRequest { + + public ShowMetadata(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/servers/").append(id).append("/metadata"), null, Metadata.class); + } + + } + + public class CreateOrUpdateMetadata extends OpenStackRequest { + + public CreateOrUpdateMetadata(String id,Metadata metadata) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/metadata"), Entity.json(metadata), Metadata.class); + } + + } + public class ReplaceMetadata extends OpenStackRequest { + + public ReplaceMetadata(String id,Metadata metadata) { + super(CLIENT, HttpMethod.PUT, new StringBuilder("/servers/").append(id).append("/metadata"), Entity.json(metadata), Metadata.class); + } + + } + + public class DeleteMetadata extends OpenStackRequest { + + public DeleteMetadata(String id,String key) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/servers/").append(id).append("/metadata/").append(key), null, Void.class); + } + + } + + + public class Delete extends OpenStackRequest { + + public Delete(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/servers/").append(id), null, Void.class); + } + + } + + public class ShowServerAddresses extends OpenStackRequest { + + public ShowServerAddresses(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/servers/").append(id).append("/ips"), null, Addresses.class); + } + + } + + public class UpdateServer extends OpenStackRequest { + + private Server server; + + public UpdateServer(String id, Server server) { + super(CLIENT, HttpMethod.PUT, new StringBuilder("/servers/").append(id), Entity.json(server), Server.class); + this.server = server; + } + + } + + public UpdateServer update(String serverId, String name, String accessIPv4, String accessIPv6) { + Server server = new Server(); + //server.setName(name); + //server.setAccessIPv4(accessIPv4); + //server.setAccessIPv6(accessIPv6); + return new UpdateServer(serverId, server); + } + + public abstract class Action extends OpenStackRequest { + + public Action(String id, Entity entity, Class returnType) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), entity, returnType); + } + + } + + public class ChangePasswordAction extends Action { + + private ChangePassword action; + + public ChangePasswordAction(String id, ChangePassword action) { + super(id, Entity.json(action), Server.class); + } + + } + + public ChangePasswordAction changePassword(String serverId, String adminPass) { + ChangePassword changePassword = new ChangePassword(); + changePassword.setAdminPass(adminPass); + return new ChangePasswordAction(serverId, changePassword); + } + + public class RebootAction extends Action { + + private Reboot action; + + public RebootAction(String id, Reboot action) { + super(id, Entity.json(action), Void.class); + } + + } + + public RebootAction reboot(String serverId, String rebootType) { + Reboot reboot = new Reboot(); + reboot.setType(rebootType); + return new RebootAction(serverId, reboot); + } + + public class RebuildAction extends Action { + + private Rebuild action; + + public RebuildAction(String id, Rebuild action) { + super(id, Entity.json(action), Server.class); + } + + } + + public RebuildAction rebuild(String serverId, Rebuild rebuild) { + return new RebuildAction(serverId, rebuild); + } + + public class ResizeAction extends Action { + + private Resize action; + + public ResizeAction(String id, Resize action) { + super(id, Entity.json(action), Void.class); + } + + } + + public ResizeAction resize(String serverId, String flavorId, String diskConfig) { + Resize resize = new Resize(); + resize.setFlavorRef(flavorId); + resize.setDiskConfig(diskConfig); + return new ResizeAction(serverId, resize); + } + + public class ConfirmResizeAction extends Action { + + public ConfirmResizeAction(String id) { + super(id, Entity.json(new ConfirmResize()), Void.class); + } + + } + + public ConfirmResizeAction confirmResize(String serverId) { + return new ConfirmResizeAction(serverId); + } + + public class RevertResizeAction extends Action { + + public RevertResizeAction(String id) { + super(id, Entity.json(new RevertResize()), Server.class); + } + + } + + public RevertResizeAction revertResize(String serverId) { + return new RevertResizeAction(serverId); + } + + public class CreateImageAction extends Action { + + public CreateImageAction(String id, CreateImage createImage) { + super(id, Entity.json(createImage), Void.class); + } + + } + + public CreateImageAction createImage(String serverId, String name, Map metadata) { + CreateImage createImage = new CreateImage(); + createImage.setName(name); + createImage.setMetadata(metadata); + return new CreateImageAction(serverId, createImage); + } + + public class StartServer extends OpenStackRequest { + + private Start action; + + private String id; + + public StartServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Start()), Void.class); + } + + } + + public class StopServer extends OpenStackRequest { + + private Stop action; + + private String id; + + public StopServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Stop()), Void.class); + } + + } + + public StartServer start(String id) { + return new StartServer(id); + } + + public StopServer stop(String id) { + return new StopServer(id); + } + + public class GetVncConsoleServer extends OpenStackRequest { + + private GetVncConsole action; + + private String id; + + public GetVncConsoleServer(String id, GetVncConsole action) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(action), VncConsole.class); + } + + } + + public GetVncConsoleServer getVncConsole(String id, String type) { + GetVncConsole action = new GetVncConsole(type); + return new GetVncConsoleServer(id, action); + } + + public class GetConsoleOutputServer extends OpenStackRequest { + + public GetConsoleOutputServer(String id, GetConsoleOutput action) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(action), ConsoleOutput.class); + } + + } + + public GetConsoleOutputServer getConsoleOutput(String id, int length) { + GetConsoleOutput action = new GetConsoleOutput(length); + return new GetConsoleOutputServer(id, action); + } + + public class PauseServer extends OpenStackRequest { + + public PauseServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Pause()), Void.class); + } + + } + + public class UnpauseServer extends OpenStackRequest { + + public UnpauseServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Unpause()), Void.class); + } + + + } + + public class LockServer extends OpenStackRequest { + + private Lock action; + + private String id; + + public LockServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Lock()), Void.class); + } + + } + + public class UnlockServer extends OpenStackRequest { + + private Unlock action; + + private String id; + + public UnlockServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Unlock()), Void.class); + } + + } + + public class SuspendServer extends OpenStackRequest { + + public SuspendServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Suspend()), Void.class); + } + + } + + public class ResumeServer extends OpenStackRequest { + + public ResumeServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Resume()), Void.class); + } + + } + + public class CreateBackupServer extends OpenStackRequest { + + public CreateBackupServer(String id, CreateBackup action) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(action), Void.class); + } + + } + + public PauseServer pause(String serverId) { + return new PauseServer(serverId); + } + + public UnpauseServer unpause(String serverId) { + return new UnpauseServer(serverId); + } + + public LockServer lock(String serverId) { + return new LockServer(serverId); + } + + public UnlockServer unlock(String serverId) { + return new UnlockServer(serverId); + } + + public SuspendServer suspend(String serverId) { + return new SuspendServer(serverId); + } + + public ResumeServer resume(String serverId) { + return new ResumeServer(serverId); + } + + public CreateBackupServer createBackup(String serverId, CreateBackup action) { + return new CreateBackupServer(serverId, action); + } + + public class RescueServer extends OpenStackRequest { + + public RescueServer(String id, Rescue action) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(action), Void.class); + } + + } + + public class UnrescueServer extends OpenStackRequest { + + public UnrescueServer(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(new Unrescue()), Void.class); + } + + } + + public RescueServer rescue(String serverId, String adminPass) { + Rescue action = new Rescue(adminPass); + return new RescueServer(serverId, action); + } + + public UnrescueServer unrescue(String serverId) { + return new UnrescueServer(serverId); + } + + public class AssociateFloatingIp extends OpenStackRequest { + + public AssociateFloatingIp(String id, com.woorea.openstack.nova.model.ServerAction.AssociateFloatingIp action) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(action), Void.class); + } + + } + + public class DisassociateFloatingIp extends OpenStackRequest { + + public DisassociateFloatingIp(String id, com.woorea.openstack.nova.model.ServerAction.DisassociateFloatingIp action) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(id).append("/action"), Entity.json(action), Void.class); + } + + } + + public AssociateFloatingIp associateFloatingIp(String serverId, String floatingIpAddress) { + com.woorea.openstack.nova.model.ServerAction.AssociateFloatingIp action = new com.woorea.openstack.nova.model.ServerAction.AssociateFloatingIp(floatingIpAddress); + return new AssociateFloatingIp(serverId, action); + } + + public DisassociateFloatingIp disassociateFloatingIp(String serverId, String floatingIpAddress) { + com.woorea.openstack.nova.model.ServerAction.DisassociateFloatingIp action = new com.woorea.openstack.nova.model.ServerAction.DisassociateFloatingIp(floatingIpAddress); + return new DisassociateFloatingIp(serverId, action); + } + + public class AttachVolume extends OpenStackRequest { + + public AttachVolume(String serverId, final VolumeAttachment volumeAttachment) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/servers/").append(serverId).append("/os-volume_attachments"), Entity.json(volumeAttachment), Void.class); + } + + } + + public class DetachVolume extends OpenStackRequest { + + public DetachVolume(String serverId, String volumeId) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/servers/").append(serverId).append("/os-volume_attachments/").append(volumeId), null, Void.class); + } + + } + + public class ListVolumeAttachments extends OpenStackRequest { + + public ListVolumeAttachments(String serverId) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/servers/").append(serverId).append("/os-volume_attachments"), null, VolumeAttachments.class); + } + + } + + public class ShowVolumeAttachment extends OpenStackRequest { + + public ShowVolumeAttachment(String serverId, String volumeAttachmentId) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/servers/").append(serverId).append("/os-volume_attachments/").append(volumeAttachmentId), null, VolumeAttachment.class); + } + + } + + public AttachVolume attachVolume(String serverId, String volumeId, String device) { + VolumeAttachment volumeAttachment = new VolumeAttachment(); + volumeAttachment.setVolumeId(volumeId); + volumeAttachment.setDevice(device); + return new AttachVolume(serverId, volumeAttachment); + } + + public DetachVolume detachVolume(String serverId, String volumeId) { + return new DetachVolume(serverId, volumeId); + } + + public ListVolumeAttachments listVolumeAttachments(String serverId) { + return new ListVolumeAttachments(serverId); + } + + public ShowVolumeAttachment showVolumeAttachment(String serverId, String volumeAttachmentId) { + return new ShowVolumeAttachment(serverId, volumeAttachmentId); + } + +} + diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/ServicesResource.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/ServicesResource.java new file mode 100644 index 000000000..c320f4a04 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/ServicesResource.java @@ -0,0 +1,60 @@ +package com.woorea.openstack.nova.api; + +import java.util.HashMap; + +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.nova.model.Service; +import com.woorea.openstack.nova.model.Services; + +/** + * Model for ServicesResource + * + */ + +public class ServicesResource { + + private final OpenStackClient CLIENT; + + public ServicesResource(OpenStackClient client) { + this.CLIENT = client; + } + + public List list() { + return new List(); + } + + public Enable enable(String host, String binary) { + return new Enable(host, binary); + } + + public Disable disable(String host, String binary) { + return new Disable(host, binary); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, "/os-services", null, Services.class); + } + } + + public class Enable extends OpenStackRequest { + + public Enable(final String host, final String binary) { + super(CLIENT, HttpMethod.PUT, "/os-services/enable", + Entity.json(new HashMap() {{ put("host", host); put("binary", binary); }}), Void.class); + } + } + + public class Disable extends OpenStackRequest { + + public Disable(final String host, final String binary) { + super(CLIENT, HttpMethod.PUT, "/os-services/disable", + Entity.json(new HashMap() {{ put("host", host); put("binary", binary); }}), Void.class); + } + } + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/AggregatesExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/AggregatesExtension.java new file mode 100644 index 000000000..fa757aff3 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/AggregatesExtension.java @@ -0,0 +1,163 @@ +package com.woorea.openstack.nova.api.extensions; + +import java.util.Map; + + +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.nova.model.HostAggregate; +import com.woorea.openstack.nova.model.HostAggregates; + +public class AggregatesExtension { + + private final OpenStackClient CLIENT; + + public AggregatesExtension(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public ShowAggregate showAggregate(String id) { + return new ShowAggregate(id); + } + + public UpdateAggregateMetadata updateAggregateMetadata(String id, + String name, String availabilityZone) { + return new UpdateAggregateMetadata(id, name, availabilityZone); + } + + public CreateAggregate createAggregate(String aggregateName, + String availabilityZoneName) { + return new CreateAggregate(aggregateName, availabilityZoneName); + } + + public DeleteAggregate deleteAggregate(String id) { + return new DeleteAggregate(id); + } + + public AddHost addHost(String aggregateId, String hostId) { + return new AddHost(aggregateId, hostId); + } + + public RemoveHost removeHost(String aggregateId, String hostId) { + return new RemoveHost(hostId, aggregateId); + } + + public SetMetadata setMetadata(String aggregateId, + String key, String value) { + return new SetMetadata(aggregateId, key, value); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, "/os-aggregates", + null, + HostAggregates.class); + } + + } + + public class ShowAggregate extends OpenStackRequest { + + public ShowAggregate(String id) { + super(CLIENT, HttpMethod.GET, + new StringBuffer("/os-aggregates/").append(id), + null, + HostAggregate.class); + } + + } + + public class UpdateAggregateMetadata extends OpenStackRequest { + public UpdateAggregateMetadata(String id, + String name, String availabilityZone) { + super(CLIENT, HttpMethod.PUT, + new StringBuffer("/os-aggregates/").append(id), + availabilityZone == null ? + Entity.json("{\"aggregate\": {\"name\": \"" + name + "\" }}") + : + Entity.json("{\"aggregate\": {\"name\": \"" + + name + + "\", \"availability_zone\": \"" + + availabilityZone + + "\" }}"), + HostAggregate.class); + } + + } + + public class CreateAggregate extends OpenStackRequest { + + public CreateAggregate(String name, String availabilityZone) { + super(CLIENT, HttpMethod.POST, + new StringBuffer("/os-aggregates"), + availabilityZone == null ? + Entity.json("{\"aggregate\": {\"name\": \"" + + name + + "\", \"availability_zone\": null }}") + : + Entity.json("{\"aggregate\": {\"name\": \"" + + name + + "\", \"availability_zone\": \"" + + availabilityZone + + "\" }}"), + HostAggregate.class); + } + + } + + public class DeleteAggregate extends OpenStackRequest { + + public DeleteAggregate(String id) { + super(CLIENT, HttpMethod.DELETE, + new StringBuffer("/os-aggregates/").append(id), + null, + null); + } + } + + public class AddHost extends OpenStackRequest { + + public AddHost(String aggregateId, String hostId) { + super(CLIENT, HttpMethod.POST, + new StringBuffer("/os-aggregates/") + .append(aggregateId).append("/action"), + Entity.json("{\"add_host\": {\"host\": \"" + + hostId + "\" }}"), + HostAggregate.class); + } + + } + + public class RemoveHost extends OpenStackRequest { + + public RemoveHost(String hostId, String aggregateId) { + super(CLIENT, HttpMethod.POST, + new StringBuffer("/os-aggregates/") + .append(aggregateId).append("/action"), + Entity.json("{\"remove_host\": {\"host\": \"" + + hostId + "\" }}"), + HostAggregate.class); + } + + } + + public class SetMetadata extends OpenStackRequest { + + public SetMetadata(String aggregateId, String key, String value) { + super(CLIENT, HttpMethod.POST, + new StringBuffer("/os-aggregates/") + .append(aggregateId).append("/action"), + Entity.json("{\"set_metadata\": {\"metadata\": { \"" + + key + "\": \"" + value + "\" }}}"), + HostAggregate.class); + } + } +} + diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CloudpipesExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CloudpipesExtension.java new file mode 100644 index 000000000..90450c805 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CloudpipesExtension.java @@ -0,0 +1,49 @@ +package com.woorea.openstack.nova.api.extensions; + + +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.nova.model.Cloudpipe; +import com.woorea.openstack.nova.model.Cloudpipes; + +public class CloudpipesExtension { + + private final OpenStackClient CLIENT; + + public CloudpipesExtension(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Create create(Cloudpipe cloudpipe) { + return new Create(cloudpipe); + } + + public class List extends OpenStackRequest { + + + public List() { + super(CLIENT, HttpMethod.GET, "/os-cloudpipes", null, Cloudpipes.class); + } + + } + + public class Create extends OpenStackRequest { + + private Cloudpipe cloudpipe; + + public Create(Cloudpipe cloudpipe) { + super(CLIENT, HttpMethod.POST, "/os-cloudpipes", Entity.json(cloudpipe), Cloudpipe.class); + this.cloudpipe = cloudpipe; + } + + } + + + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CredentialsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CredentialsExtension.java new file mode 100644 index 000000000..b689fd6b1 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CredentialsExtension.java @@ -0,0 +1,43 @@ +package com.woorea.openstack.nova.api.extensions; + + +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.nova.model.Certificate; + +public class CredentialsExtension { + + private final OpenStackClient CLIENT; + + public CredentialsExtension(OpenStackClient client) { + CLIENT = client; + } + + public Create createCertificate(String id) { + return new Create(id); + } + + public Show showCertificate(String id) { + return new Show(); + } + + public class Create extends OpenStackRequest { + + public Create(String id) { + super(CLIENT, HttpMethod.GET, new StringBuffer("/os-certificates").append(id).toString(), null, Certificate.class); + } + + } + + public class Show extends OpenStackRequest { + + public Show() { + super(CLIENT, HttpMethod.GET, "/os-certificates", null, Certificate.class); + } + + } + + + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpDnsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpDnsExtension.java new file mode 100644 index 000000000..e2a399a32 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpDnsExtension.java @@ -0,0 +1,89 @@ +package com.woorea.openstack.nova.api.extensions; + + +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.nova.model.FloatingIpDomain; +import com.woorea.openstack.nova.model.FloatingIpDomains; + +public class FloatingIpDnsExtension { + + private final OpenStackClient CLIENT; + + public FloatingIpDnsExtension(OpenStackClient client) { + CLIENT = client; + } + + public ListDomains listFloatingIpDomains() { + return new ListDomains(); + } + + public CreateDomain create(FloatingIpDomain floatingIpDomain) { + return new CreateDomain(floatingIpDomain); + } + + public ShowDomain show(String id) { + return new ShowDomain(id); + } + + public UpdateDomain update(FloatingIpDomain floatingIpDomain) { + return new UpdateDomain(floatingIpDomain); + } + + public DeleteDomain delete(String id) { + return new DeleteDomain(id); + } + + public class ListDomains extends OpenStackRequest { + + public ListDomains() { + super(CLIENT, HttpMethod.GET, "/os-floating-ip-dns", null, FloatingIpDomains.class); + } + + } + + public class CreateDomain extends OpenStackRequest { + + private FloatingIpDomain floatingIpDomain; + + public CreateDomain(FloatingIpDomain floatingIpDomain) { + super(CLIENT, HttpMethod.POST, "/os-floating-ip-dns", Entity.json(floatingIpDomain), FloatingIpDomain.class); + this.floatingIpDomain = floatingIpDomain; + } + + } + + public class ShowDomain extends OpenStackRequest { + + public ShowDomain(String id) { + super(CLIENT, HttpMethod.GET, new StringBuffer("/os-floating-ip-dns/").append(id).toString(), null, FloatingIpDomain.class); + } + + } + + + public static class UpdateDomain extends OpenStackRequest { + + private FloatingIpDomain floatingIpDomain; + + public UpdateDomain(FloatingIpDomain floatingIpDomain) { + //super(CLIENT, HttpMethod.PUT, new StringBuffer("/os-floating-ip-dns/").append(id).toString(), Entity.json(floatingIpDomain), FloatingIpDomain.class); + this.floatingIpDomain = floatingIpDomain; + } + + } + + + public class DeleteDomain extends OpenStackRequest { + + public DeleteDomain(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuffer("/os-floating-ip-dns/").append(id).toString(), null, Void.class); + } + + } + + + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpPoolsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpPoolsExtension.java new file mode 100644 index 000000000..cfcba237d --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpPoolsExtension.java @@ -0,0 +1,31 @@ +package com.woorea.openstack.nova.api.extensions; + + +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.nova.model.FloatingIpPools; + +public class FloatingIpPoolsExtension { + + private final OpenStackClient CLIENT; + + public FloatingIpPoolsExtension(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, "/os-floating-ip-pools", null, FloatingIpPools.class); + } + + } + + + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java new file mode 100644 index 000000000..0923b7e81 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpsExtension.java @@ -0,0 +1,67 @@ +package com.woorea.openstack.nova.api.extensions; + +import java.util.HashMap; +import java.util.Map; + + +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.nova.model.FloatingIp; +import com.woorea.openstack.nova.model.FloatingIps; + +public class FloatingIpsExtension { + + private final OpenStackClient CLIENT; + + public FloatingIpsExtension(OpenStackClient client) { + CLIENT = client; + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, "/os-floating-ips", null, FloatingIps.class); + } + + } + + public class Allocate extends OpenStackRequest { + + public Allocate(Entity entity) { + super(CLIENT, HttpMethod.POST, "/os-floating-ips", entity, FloatingIp.class); + } + + } + + public class Deallocate extends OpenStackRequest { + + public Deallocate(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuffer("/os-floating-ips/").append(id).toString(), null, Void.class); + } + + } + + public List list() { + return new List(); + } + + public Allocate allocate(String pool) { + Entity entity=null; + if(pool!=null) { + Map body = new HashMap(); + body.put("pool", pool); + entity=Entity.json(body); + } + return new Allocate(entity); + } + + public Deallocate deallocate(String id) { + return new Deallocate(id); + } + + + +} + diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HostsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HostsExtension.java new file mode 100644 index 000000000..9a4814dfc --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HostsExtension.java @@ -0,0 +1,44 @@ +package com.woorea.openstack.nova.api.extensions; + + +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.nova.model.Host; +import com.woorea.openstack.nova.model.Hosts; + +public class HostsExtension { + + private final OpenStackClient CLIENT; + + public HostsExtension(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Show show(String id) { + return new Show(id); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, "/os-hosts", null, Hosts.class); + } + + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, new StringBuffer("/os-hosts/").append(id).toString(), null, Host.class); + } + + } + + + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java new file mode 100644 index 000000000..ed1ad100b --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java @@ -0,0 +1,5 @@ +package com.woorea.openstack.nova.api.extensions; + +public class HypervisorsExtension { + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/KeyPairsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/KeyPairsExtension.java new file mode 100644 index 000000000..5e2c55586 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/KeyPairsExtension.java @@ -0,0 +1,65 @@ +package com.woorea.openstack.nova.api.extensions; + + +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.nova.model.KeyPair; +import com.woorea.openstack.nova.model.KeyPairs; + +public class KeyPairsExtension { + + private final OpenStackClient CLIENT; + + public KeyPairsExtension(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Create create(String name, String publicKey) { + KeyPair keyPairForCreate = new KeyPair(name, publicKey); + return new Create(keyPairForCreate); + } + + public Create create(String name) { + return create(name, null); + } + + public Delete delete(String name) { + return new Delete(name); + } + + public class Create extends OpenStackRequest { + + private KeyPair keyPairForCreate; + + public Create(KeyPair keyPairForCreate) { + super(CLIENT, HttpMethod.POST, "/os-keypairs", Entity.json(keyPairForCreate), KeyPair.class); + this.keyPairForCreate = keyPairForCreate; + } + + } + + public class Delete extends OpenStackRequest { + + private String name; + + public Delete(String name) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-keypairs/").append(name).toString(), null, Void.class); + } + + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, "/os-keypairs", null, KeyPairs.class); + } + + } + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/NetworksExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/NetworksExtension.java new file mode 100644 index 000000000..ad316e087 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/NetworksExtension.java @@ -0,0 +1,82 @@ +package com.woorea.openstack.nova.api.extensions; + + +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.nova.model.Network; +import com.woorea.openstack.nova.model.Networks; + +public class NetworksExtension { + + private final OpenStackClient CLIENT; + + public NetworksExtension(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Show show(String id) { + return new Show(id); + } + + public Delete delete(String id) { + return new Delete(id); + } + + public Disassociate disassociate(String id) { + return new Disassociate(id); + } + + public class List extends OpenStackRequest { + + + public List() { + super(CLIENT, HttpMethod.GET, "/os-networks", null, Networks.class); + } + + } + + public class Create extends OpenStackRequest { + + private Network network; + + public Create(Network network) { + super(CLIENT, HttpMethod.POST, "/os-networks", Entity.json(network), Network.class); + this.network = network; + } + + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-networks/").append(id).toString(), null, Network.class); + } + + } + + public class Disassociate extends OpenStackRequest { + + public Disassociate(String id) { + super(CLIENT, HttpMethod.POST, new StringBuilder("/os-networks/").append(id).toString(), Entity.json("{\"action\":\"disassociate\"}"), Void.class); + ; + } + + } + + public class Delete extends OpenStackRequest { + + public Delete(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-networks/").append(id).toString(), null, Void.class); + } + + } + + + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java new file mode 100644 index 000000000..58dfa4f8d --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SecurityGroupsExtension.java @@ -0,0 +1,184 @@ +package com.woorea.openstack.nova.api.extensions; + + +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.nova.model.SecurityGroup; +import com.woorea.openstack.nova.model.SecurityGroupForCreate; +import com.woorea.openstack.nova.model.SecurityGroupRuleForCreate; +import com.woorea.openstack.nova.model.SecurityGroups; + +public class SecurityGroupsExtension { + + private final OpenStackClient CLIENT; + + public SecurityGroupsExtension(OpenStackClient client) { + CLIENT = client; + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, "/os-security-groups", null, SecurityGroups.class); + } + + } + + public class Create extends OpenStackRequest { + + private SecurityGroupForCreate securityGroupForCreate; + + public Create(SecurityGroupForCreate securityGroupForCreate) { + super(CLIENT, HttpMethod.POST, "/os-security-groups", Entity.json(securityGroupForCreate), SecurityGroup.class); + this.securityGroupForCreate = securityGroupForCreate; + } + + } + + public class Show extends OpenStackRequest { + + /** + * @deprecated + * @param id + */ + public Show(Integer id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-security-groups/").append(id).toString(), null, SecurityGroup.class); + } + public Show(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-security-groups/").append(id).toString(), null, SecurityGroup.class); + } + + } + + public class Delete extends OpenStackRequest { + + /** + * + * @param id + * @deprecated + */ + public Delete(Integer id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-security-groups/").append(String.valueOf(id)).toString(), null, Void.class); + } + public Delete(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-security-groups/").append(id).toString(), null, Void.class); + } + + } + + public class CreateRule extends OpenStackRequest { + + private SecurityGroupRuleForCreate securityGroupRuleForCreate; + + public CreateRule(SecurityGroupRuleForCreate securityGroupRuleForCreate) { + super(CLIENT, HttpMethod.POST, "/os-security-group-rules", Entity.json(securityGroupRuleForCreate), SecurityGroup.Rule.class); + this.securityGroupRuleForCreate = securityGroupRuleForCreate; + } + } + + public class DeleteRule extends OpenStackRequest { + + /** + * + * @param id + * @deprecated + */ + public DeleteRule(Integer id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-security-group-rules/").append(String.valueOf(id)).toString(), null, Void.class); + } + + public DeleteRule(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-security-group-rules/").append(String.valueOf(id)).toString(), null, Void.class); + } + } + + public List listSecurityGroups() { + return new List(); + } + + public Create createSecurityGroup(String name, + String description) { + return new Create(new SecurityGroupForCreate(name, description)); + } + + public Create createSecurityGroup(String name) { + return createSecurityGroup(name, null); + } + + public Show showSecurityGroup(Integer id) { + return new Show(String.valueOf(id)); + } + + public Show showSecurityGroup(String id) { + return new Show(id); + } + public Delete deleteSecurityGroup(Integer id) { + return new Delete(String.valueOf(id)); + } + + public Delete deleteSecurityGroup(String id) { + return new Delete(id); + } + + /** + * + * @param parentSecurityGroupId + * @param ipProtocol + * @param fromPort + * @param toPort + * @param cidr + * @return + * @deprecated Use {@link #createSecurityGroupRule(String, String, Integer, Integer, String)} + */ + public CreateRule createSecurityGroupRule( + Integer parentSecurityGroupId, String ipProtocol, Integer fromPort, + Integer toPort, String cidr) { + SecurityGroupRuleForCreate securityGroupRuleForCreate = new SecurityGroupRuleForCreate( + parentSecurityGroupId, ipProtocol, fromPort, toPort, cidr); + return new CreateRule(securityGroupRuleForCreate); + } + /** + * + * @param parentSecurityGroupId + * @param ipProtocol + * @param fromPort + * @param toPort + * @param sourceGroupId + * @return + * @deprecated Use {@link #createSecurityGroupRule(String, String, String, Integer, Integer)} + */ + public CreateRule createSecurityGroupRule( + Integer parentSecurityGroupId, String ipProtocol, Integer fromPort, + Integer toPort, Integer sourceGroupId) { + SecurityGroupRuleForCreate securityGroupRuleForCreate = new SecurityGroupRuleForCreate( + parentSecurityGroupId, ipProtocol, fromPort, toPort, + sourceGroupId); + return new CreateRule(securityGroupRuleForCreate); + } + + public CreateRule createSecurityGroupRule( + String parentSecurityGroupId, String ipProtocol, Integer fromPort, + Integer toPort, String cidr) { + SecurityGroupRuleForCreate securityGroupRuleForCreate = new SecurityGroupRuleForCreate( + parentSecurityGroupId, ipProtocol, fromPort, toPort, cidr); + return new CreateRule(securityGroupRuleForCreate); + } + + public CreateRule createSecurityGroupRule( + String parentSecurityGroupId,String sourceGroupId,String ipProtocol, Integer fromPort, + Integer toPort) { + SecurityGroupRuleForCreate securityGroupRuleForCreate = new SecurityGroupRuleForCreate( + parentSecurityGroupId, sourceGroupId,ipProtocol, fromPort, toPort + ); + return new CreateRule(securityGroupRuleForCreate); + } + public DeleteRule deleteSecurityGroupRule(String id) { + return new DeleteRule(id); + } + public DeleteRule deleteSecurityGroupRule(Integer id) { + return new DeleteRule(String.valueOf(id)); + } + +} diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SnapshotsExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SnapshotsExtension.java new file mode 100644 index 000000000..62c2542b6 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/SnapshotsExtension.java @@ -0,0 +1,86 @@ +package com.woorea.openstack.nova.api.extensions; + + +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.nova.model.Metadata; +import com.woorea.openstack.nova.model.Snapshot; +import com.woorea.openstack.nova.model.SnapshotForCreate; +import com.woorea.openstack.nova.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 id) { + return new ShowMetadata(id); + } + + + public Delete delete(String id) { + return new Delete(id); + } + + public class List extends OpenStackRequest { + + public List(boolean detail) { + super(CLIENT, HttpMethod.GET, detail ? "/os-snapshots/detail" : "/os-snapshots", null, Snapshots.class); + } + + } + + public class Create extends OpenStackRequest { + + private SnapshotForCreate snapshotForCreate; + + public Create(SnapshotForCreate snapshotForCreate) { + super(CLIENT, HttpMethod.POST, "/os-snapshots", Entity.json(snapshotForCreate), SnapshotForCreate.class); + this.snapshotForCreate = snapshotForCreate; + } + + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-snapshots/").append(id).toString(), null, Snapshot.class); + } + + } + + public class ShowMetadata extends OpenStackRequest { + + public ShowMetadata(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-snapshots/").append(id).append("/metadata").toString(), null, Metadata.class); + } + + } + + public class Delete extends OpenStackRequest { + + public Delete(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-snapshots/").append(id).toString(), null, Void.class); + } + + } + +} + diff --git a/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/VolumesExtension.java b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/VolumesExtension.java new file mode 100644 index 000000000..de3557731 --- /dev/null +++ b/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/VolumesExtension.java @@ -0,0 +1,106 @@ +package com.woorea.openstack.nova.api.extensions; + +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.nova.model.Metadata; +import com.woorea.openstack.nova.model.Volume; +import com.woorea.openstack.nova.model.VolumeForCreate; +import com.woorea.openstack.nova.model.VolumeForImageCreate; +import com.woorea.openstack.nova.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 class List extends OpenStackRequest { + + public List(boolean detail) { + super(CLIENT, HttpMethod.GET, detail ? "/os-volumes/detail" + : "/os-volumes", null, Volumes.class); + } + + } + + public class Create extends OpenStackRequest { + + // private Volume volume; + + public Create(VolumeForCreate volume) { + super(CLIENT, HttpMethod.POST, "/os-volumes", Entity.json(volume), + Volume.class); + // this.volume = volume; + } + + } + + // 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"), + Entity.json(volumeForImageCreate), Void.class); + } + + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-volumes/") + .append(id).toString(), null, Volume.class); + } + + } + + public class ShowMetadata extends OpenStackRequest { + + public ShowMetadata(String id) { + super(CLIENT, HttpMethod.GET, new StringBuilder("/os-volumes/") + .append(id).append("/metadata").toString(), null, + Metadata.class); + } + + } + + public class Delete extends OpenStackRequest { + + public Delete(String id) { + super(CLIENT, HttpMethod.DELETE, new StringBuilder("/os-volumes/") + .append(id).toString(), null, Void.class); + } + + } + +} diff --git a/nova-model/pom.xml b/nova-model/pom.xml new file mode 100644 index 000000000..729308bcd --- /dev/null +++ b/nova-model/pom.xml @@ -0,0 +1,18 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + + + javax.xml.bind + jaxb-api + 2.2.12 + + + nova-model + OpenStack Nova Model + OpenStack Nova Model + \ No newline at end of file diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Certificate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Certificate.java new file mode 100644 index 000000000..d93a978e6 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Certificate.java @@ -0,0 +1,36 @@ +package com.woorea.openstack.nova.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("certificate") +public class Certificate { + + private String data; + + @JsonProperty("private_key") + private String privateKey; + + /** + * @return the data + */ + public String getData() { + return data; + } + + /** + * @return the privateKey + */ + public String getPrivateKey() { + return privateKey; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Certificate [data=" + data + ", privateKey=" + privateKey + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Cloudpipe.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Cloudpipe.java new file mode 100644 index 000000000..ff3e78445 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Cloudpipe.java @@ -0,0 +1,134 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Calendar; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("cloudpipe") +public class Cloudpipe implements Serializable { + + private String projectId; + + private String internalIp; + + private String publicIp; + + private String publicPort; + + private String state; + + private String instanceId; + + private Calendar createdAt; + + /** + * @return the projectId + */ + public String getProjectId() { + return projectId; + } + + /** + * @param projectId the projectId to set + */ + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + /** + * @return the internalIp + */ + public String getInternalIp() { + return internalIp; + } + + /** + * @param internalIp the internalIp to set + */ + public void setInternalIp(String internalIp) { + this.internalIp = internalIp; + } + + /** + * @return the publicIp + */ + public String getPublicIp() { + return publicIp; + } + + /** + * @param publicIp the publicIp to set + */ + public void setPublicIp(String publicIp) { + this.publicIp = publicIp; + } + + /** + * @return the publicPort + */ + public String getPublicPort() { + return publicPort; + } + + /** + * @param publicPort the publicPort to set + */ + public void setPublicPort(String publicPort) { + this.publicPort = publicPort; + } + + /** + * @return the state + */ + public String getState() { + return state; + } + + /** + * @param state the state to set + */ + public void setState(String state) { + this.state = state; + } + + /** + * @return the instanceId + */ + public String getInstanceId() { + return instanceId; + } + + /** + * @param instanceId the instanceId to set + */ + public void setInstanceId(String instanceId) { + this.instanceId = instanceId; + } + + /** + * @return the createdAt + */ + public Calendar getCreatedAt() { + return createdAt; + } + + /** + * @param createdAt the createdAt to set + */ + public void setCreatedAt(Calendar createdAt) { + this.createdAt = createdAt; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "CloudPipe [projectId=" + projectId + ", internalIp=" + + internalIp + ", publicIp=" + publicIp + ", publicPort=" + + publicPort + ", state=" + state + ", instanceId=" + + instanceId + ", createdAt=" + createdAt + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Cloudpipes.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Cloudpipes.java new file mode 100644 index 000000000..6d785de12 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Cloudpipes.java @@ -0,0 +1,28 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Cloudpipes implements Serializable { + + @JsonProperty("cloudpipes") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Flavors [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Extension.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Extension.java new file mode 100644 index 000000000..0d7176f75 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Extension.java @@ -0,0 +1,75 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("extension") +public class Extension implements Serializable { + + private String alias; + + private String description; + + private String name; + + private String namespace; + + private Calendar updated; + + private List links; + + /** + * @return the alias + */ + public String getAlias() { + return alias; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the namespace + */ + public String getNamespace() { + return namespace; + } + + /** + * @return the updated + */ + public Calendar getUpdated() { + return updated; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Extension [alias=" + alias + ", description=" + description + + ", name=" + name + ", namespace=" + namespace + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Extensions.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Extensions.java new file mode 100644 index 000000000..b8c3bed5f --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Extensions.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Extensions implements Iterable, Serializable { + + @JsonProperty("extensions") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Extensions [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Flavor.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Flavor.java new file mode 100644 index 000000000..bdc2dd873 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Flavor.java @@ -0,0 +1,239 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("flavor") +public class Flavor implements Serializable { + + private String id; + + private String name; + + private Integer vcpus; + + private Integer ram; + + private Integer disk; + + @JsonProperty("OS-FLV-EXT-DATA:ephemeral") + private Integer ephemeral; + + private String swap; + + @JsonProperty("rxtx_factor") + private Float rxtxFactor; + + @JsonProperty("OS-FLV-DISABLED:disabled") + private Boolean disabled; + + @JsonProperty("rxtx_quota") + private Integer rxtxQuota; + + @JsonProperty("rxtx_cap") + private Integer rxtxCap; + + private List links; + + @JsonProperty("os-flavor-access:is_public") + private Boolean isPublic; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = 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 vcpus + */ + public Integer getVcpus() { + return vcpus; + } + + /** + * @param vcpus the vcpus to set + */ + public void setVcpus(Integer vcpus) { + this.vcpus = vcpus; + } + + /** + * @return the ram + */ + public Integer getRam() { + return ram; + } + + /** + * @param ram the ram to set + */ + public void setRam(Integer ram) { + this.ram = ram; + } + + /** + * @return the disk + */ + public Integer getDisk() { + return disk; + } + + /** + * @param disk the disk to set + */ + public void setDisk(Integer disk) { + this.disk = disk; + } + + /** + * @return the ephemeral + */ + public Integer getEphemeral() { + return ephemeral; + } + + /** + * @param ephemeral the ephemeral to set + */ + public void setEphemeral(Integer ephemeral) { + this.ephemeral = ephemeral; + } + + /** + * @return the swap + */ + public String getSwap() { + return swap; + } + + /** + * @param swap the swap to set + */ + public void setSwap(String swap) { + this.swap = swap; + } + + /** + * @return the rxtxFactor + */ + public Float getRxtxFactor() { + return rxtxFactor; + } + + /** + * @param rxtxFactor the rxtxFactor to set + */ + public void setRxtxFactor(Float rxtxFactor) { + this.rxtxFactor = rxtxFactor; + } + + /** + * @return the rxtxQuota + */ + public Integer getRxtxQuota() { + return rxtxQuota; + } + + /** + * @param rxtxQuota the rxtxQuota to set + */ + public void setRxtxQuota(Integer rxtxQuota) { + this.rxtxQuota = rxtxQuota; + } + + /** + * @return the rxtxCap + */ + public Integer getRxtxCap() { + return rxtxCap; + } + + /** + * @param rxtxCap the rxtxCap to set + */ + public void setRxtxCap(Integer rxtxCap) { + this.rxtxCap = rxtxCap; + } + + /** + * @return the disabled + */ + public Boolean getDisabled() { + return disabled; + } + + /** + * @param disabled the disabled to set + */ + public void setDisabled(Boolean disabled) { + this.disabled = disabled; + } + + /** + * @return the isPublic + */ + public Boolean isPublic() { + return isPublic; + } + + /** + * @param isPublic the isPublic to set + */ + public void setPublic(Boolean isPublic) { + this.isPublic = isPublic; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + /** + * @param links the links to set + */ + public void setLinks(List links) { + this.links = links; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Flavor [id=" + id + ", name=" + name + ", vcpus=" + vcpus + + ", ram=" + ram + ", disk=" + disk + ", ephemeral=" + + ephemeral + ", swap=" + swap + ", rxtxFactor=" + rxtxFactor + + ", disabled=" + disabled + ", rxtxQuota=" + rxtxQuota + + ", rxtxCap=" + rxtxCap + ", links=" + links + ", isPublic=" + + isPublic + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/FlavorForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/FlavorForCreate.java new file mode 100644 index 000000000..36d5d5223 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/FlavorForCreate.java @@ -0,0 +1,142 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("flavor") +public class FlavorForCreate implements Serializable { + + private String id; + + private String name; + + private String vcpus; + + private Integer ram; + + private String disk; + + @JsonProperty("OS-FLV-EXT-DATA:ephemeral") + private Integer ephemeral; + + private String swap; + + @JsonProperty("rxtx_factor") + private Float rxtxFactor; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = 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 vcpus + */ + public String getVcpus() { + return vcpus; + } + + /** + * @param vcpus the vcpus to set + */ + public void setVcpus(String vcpus) { + this.vcpus = vcpus; + } + + /** + * @return the ram + */ + public Integer getRam() { + return ram; + } + + /** + * @param ram the ram to set + */ + public void setRam(Integer ram) { + this.ram = ram; + } + + /** + * @return the disk + */ + public String getDisk() { + return disk; + } + + /** + * @param disk the disk to set + */ + public void setDisk(String disk) { + this.disk = disk; + } + + /** + * @return the ephemeral + */ + public Integer getEphemeral() { + return ephemeral; + } + + /** + * @param ephemeral the ephemeral to set + */ + public void setEphemeral(Integer ephemeral) { + this.ephemeral = ephemeral; + } + + /** + * @return the swap + */ + public String getSwap() { + return swap; + } + + /** + * @param swap the swap to set + */ + public void setSwap(String swap) { + this.swap = swap; + } + + /** + * @return the rxtxFactor + */ + public Float getRxtxFactor() { + return rxtxFactor; + } + + /** + * @param rxtxFactor the rxtxFactor to set + */ + public void setRxtxFactor(Float rxtxFactor) { + this.rxtxFactor = rxtxFactor; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Flavors.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Flavors.java new file mode 100644 index 000000000..e95706506 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Flavors.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Flavors implements Iterable, Serializable { + + @JsonProperty("flavors") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Flavors [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIp.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIp.java new file mode 100644 index 000000000..b2e96caa6 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIp.java @@ -0,0 +1,67 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("floating_ip") +public class FloatingIp implements Serializable { + + private String id; + + private String pool; + + private String ip; + + @JsonProperty("fixed_ip") + private String fixedIp; + + @JsonProperty("instance_id") + private String instanceId; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the pool + */ + public String getPool() { + return pool; + } + + /** + * @return the ip + */ + public String getIp() { + return ip; + } + + /** + * @return the fixedIp + */ + public String getFixedIp() { + return fixedIp; + } + + /** + * @return the instanceId + */ + public String getInstanceId() { + return instanceId; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "FloatingIp [id=" + id + ", pool=" + pool + ", ip=" + ip + + ", fixedIp=" + fixedIp + ", instanceId=" + instanceId + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpDomain.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpDomain.java new file mode 100644 index 000000000..806fde611 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpDomain.java @@ -0,0 +1,58 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("floating-ip-pool") +public class FloatingIpDomain implements Serializable { + + private String domain; + + private String scope; + + private String project; + + @JsonProperty("availabilityZone") + private String availabilityZone; + + /** + * @return the domain + */ + public String getDomain() { + return domain; + } + + /** + * @return the scope + */ + public String getScope() { + return scope; + } + + /** + * @return the project + */ + public String getProject() { + return project; + } + + /** + * @return the availabilityZone + */ + public String getAvailabilityZone() { + return availabilityZone; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "FloatingIpDomain [domain=" + domain + ", scope=" + scope + + ", project=" + project + ", availabilityZone=" + + availabilityZone + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpDomains.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpDomains.java new file mode 100644 index 000000000..cd3d544d8 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpDomains.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class FloatingIpDomains implements Iterable, Serializable { + + @JsonProperty("domain_entries") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "FloatingIpDomains [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpPools.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpPools.java new file mode 100644 index 000000000..2fc642b63 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpPools.java @@ -0,0 +1,57 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import com.woorea.openstack.nova.model.FloatingIpPools.FloatingIpPool; + +public class FloatingIpPools implements Iterable, Serializable { + + public static class FloatingIpPool implements Serializable { + + private String name; + + /** + * @return the name + */ + public String getName() { + return name; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "FloatingIpPool [name=" + name + "]"; + } + + } + + @JsonProperty("floating_ip_pools") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "FloatingIpPools [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIps.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIps.java new file mode 100644 index 000000000..93c19a09b --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIps.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class FloatingIps implements Iterable, Serializable { + + @JsonProperty("floating_ips") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "FloatingIps [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Host.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Host.java new file mode 100644 index 000000000..2982bbabc --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Host.java @@ -0,0 +1,109 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Host implements Serializable { + + public static final class ResourceWrapper implements Serializable { + + public static final class Resource implements Serializable { + + private String project; + + @JsonProperty("memory_mb") + private Integer memoryMb; + + private String host; + + private Integer cpu; + + @JsonProperty("disk_gb") + private Integer diskGb; + + /** + * @return the project + */ + public String getProject() { + return project; + } + + /** + * @return the memoryMb + */ + public Integer getMemoryMb() { + return memoryMb; + } + + /** + * @return the host + */ + public String getHost() { + return host; + } + + /** + * @return the cpu + */ + public Integer getCpu() { + return cpu; + } + + /** + * @return the diskGb + */ + public Integer getDiskGb() { + return diskGb; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Resource [project=" + project + ", memoryMb=" + + memoryMb + ", host=" + host + ", cpu=" + cpu + + ", diskGb=" + diskGb + "]"; + } + + } + + private Resource resource; + + /** + * @return the resource + */ + public Resource getResource() { + return resource; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "ResourceWrapper [resource=" + resource + "]"; + } + + } + + private List host; + + /** + * @return the host + */ + public List getHost() { + return host; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Host [host=" + host + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/HostAggregate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/HostAggregate.java new file mode 100644 index 000000000..4f90e71e4 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/HostAggregate.java @@ -0,0 +1,110 @@ +package com.woorea.openstack.nova.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; + +@JsonRootName("aggregate") +public class HostAggregate implements Serializable { + + private String id; + + private String name; + + @JsonProperty("availability_zone") + private String availabilityZone; + + @JsonProperty("created_at") + private String createdAt; + + @JsonProperty("updated_at") + private String updatedAt; + + @JsonProperty("deleted_at") + private String deletedAt; + + private Boolean deleted; + + private List hosts; + + private Map metadata; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the availabilityZone + */ + public String getAvailabilityZone() { + return availabilityZone; + } + + /** + * @return the createdAt + */ + public String getCreatedAt() { + return createdAt; + } + + /** + * @return the updatedAt + */ + public String getUpdatedAt() { + return updatedAt; + } + + /** + * @return the deletedAt + */ + public String getDeletedAt() { + return deletedAt; + } + + /** + * @return the deleted + */ + public Boolean getDeleted() { + return deleted; + } + + /** + * @return the hosts + */ + public List getHosts() { + return hosts; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "HostAggregate [id=" + id + ", name=" + name + + ", availabilityZone=" + availabilityZone + ", createdAt=" + + createdAt + ", updatedAt=" + updatedAt + ", deletedAt=" + + deletedAt + ", deleted=" + deleted + ", hosts=" + hosts + + ", metadata=" + metadata + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/HostAggregates.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/HostAggregates.java new file mode 100644 index 000000000..2d61d4d13 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/HostAggregates.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class HostAggregates implements Iterable, Serializable { + + @JsonProperty("aggregates") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "HostAggregates [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Hosts.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Hosts.java new file mode 100644 index 000000000..35d0b3806 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Hosts.java @@ -0,0 +1,77 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Hosts implements Iterable, Serializable { + + public static final class Host { + + private String zone; + + @JsonProperty("host_name") + private String hostName; + + private String service; + + /** + * @return the hostName + */ + public String getHostName() { + return hostName; + } + + /** + * @return the service + */ + public String getService() { + return service; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Host [hostName=" + hostName + ", service=" + service + "]"; + } + + } + + @JsonProperty("hosts") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Hosts [list=" + list + "]"; + } + + + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Hypervisor.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Hypervisor.java new file mode 100644 index 000000000..8a60de7d3 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Hypervisor.java @@ -0,0 +1,37 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +/** + * Model for Hypervisor + * + */ +@JsonRootName("hypervisor") +public class Hypervisor implements Serializable { + + private String id; + private String hypervisor_hostname; + + public String getId() { + return id; + } + + public void setHypervisor_hostname(String hypervisor_hostname) { + this.hypervisor_hostname = hypervisor_hostname; + } + + public String getHypervisor_hostname() { + return hypervisor_hostname; + } + + @Override + public String toString() { + return "Hypervisor {" + + "hypervisor_hostname='" + hypervisor_hostname + + ", id='" + id + + '}'; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Hypervisors.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Hypervisors.java new file mode 100644 index 000000000..8732790e3 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Hypervisors.java @@ -0,0 +1,33 @@ +package com.woorea.openstack.nova.model; + +import java.util.Iterator; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Model for List of Hypervisors + * + */ +public class Hypervisors implements Iterable { + + @JsonProperty("hypervisors") + 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 "Hypervisors [list=" + list + "]"; + } +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Image.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Image.java new file mode 100644 index 000000000..a42d6771d --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Image.java @@ -0,0 +1,232 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("image") +public class Image implements Serializable { + + public static final class Server implements Serializable { + + private String id; + + private List links; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + @Override + public String toString() { + return "Server [id=" + id + ", links=" + links + "]"; + } + + } + + private String id; + + private String status; + + private String name; + + private Integer progress; + + private Integer minRam; + + private Integer minDisk; + + private Calendar created; + + private Calendar updated; + + @JsonProperty("OS-EXT-IMG-SIZE:size") + private Long size; + + private Map metadata; + + private Server server; + + private List links; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(String id) { + this.id = id; + } + + /** + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * @param status the status to set + */ + public void setStatus(String status) { + this.status = status; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the progress + */ + public Integer getProgress() { + return progress; + } + + /** + * @param progress the progress to set + */ + public void setProgress(Integer progress) { + this.progress = progress; + } + + /** + * @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 created + */ + public Calendar getCreated() { + return created; + } + + /** + * @param created the created to set + */ + public void setCreated(Calendar created) { + this.created = created; + } + + /** + * @return the updated + */ + public Calendar getUpdated() { + return updated; + } + + /** + * @param updated the updated to set + */ + public void setUpdated(Calendar updated) { + this.updated = updated; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * @return the size + */ + public Long getSize() { + return size; + } + + /** + * @param metadata the metadata to set + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + /** + * @return the server + */ + public Server getServer() { + return server; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + /** + * @param links the links to set + */ + public void setLinks(List links) { + this.links = links; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Image [id=" + id + ", status=" + status + ", name=" + name + + ", progress=" + progress + ", minRam=" + minRam + + ", minDisk=" + minDisk + ", created=" + (created != null ? created.getTime() : null) + + ", updated=" + (updated != null ? updated.getTime() : null) + ", size=" + size + ", metadata=" + + metadata + ", server="+server+", links=" + links + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/ImageFromVolume.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/ImageFromVolume.java new file mode 100644 index 000000000..3cd993c8e --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/ImageFromVolume.java @@ -0,0 +1,112 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("os-volume_upload_image") +public class ImageFromVolume implements Serializable { + + @JsonProperty("id") + String id; + @JsonProperty("updates_at") + String updates_at; + @JsonProperty("status") + String status; + @JsonProperty("display_description") + String display_description; + @JsonProperty("size") + String size; + @JsonProperty("volume_type") + String volume_type; + @JsonProperty("image_id") + String image_id; + @JsonProperty("container_format") + String container_format; + @JsonProperty("disk_format") + String disk_format; + @JsonProperty("image_name") + String image_name; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getUpdates_at() { + return updates_at; + } + + public void setUpdates_at(String updates_at) { + this.updates_at = updates_at; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getDisplay_description() { + return display_description; + } + + public void setDisplay_description(String display_description) { + this.display_description = display_description; + } + + public String getSize() { + return size; + } + + public void setSize(String size) { + this.size = size; + } + + public String getVolume_type() { + return volume_type; + } + + public void setVolume_type(String volume_type) { + this.volume_type = volume_type; + } + + public String getImage_id() { + return image_id; + } + + public void setImage_id(String image_id) { + this.image_id = image_id; + } + + 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/nova-model/src/main/java/com/woorea/openstack/nova/model/Images.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Images.java new file mode 100644 index 000000000..e45505272 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Images.java @@ -0,0 +1,35 @@ +package com.woorea.openstack.nova.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(); + } + + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Images [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPair.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPair.java new file mode 100644 index 000000000..23fa2088e --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPair.java @@ -0,0 +1,98 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("keypair") +public class KeyPair implements Serializable { + + private String name; + + @JsonProperty("user_id") + private String userId; + + @JsonProperty("public_key") + private String publicKey; + + @JsonProperty("private_key") + private String privateKey; + + private String fingerprint; + + public KeyPair() { + super(); + } + + public KeyPair(String name) { + this.name = name; + } + + public KeyPair(String name, String publicKey) { + this(name); + this.publicKey = publicKey; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the userId + */ + public String getUserId() { + return userId; + } + + /** + * @return the publicKey + */ + public String getPublicKey() { + return publicKey; + } + + /** + * @param publicKey the publicKey to set + */ + public void setPublicKey(String publicKey) { + this.publicKey = publicKey; + } + + /** + * @return the privateKey + */ + public String getPrivateKey() { + return privateKey; + } + + /** + * @return the fingerprint + */ + public String getFingerprint() { + return fingerprint; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "KeyPair [name=" + name + ", userId=" + userId + ", publicKey=" + + publicKey + ", privateKey=" + privateKey + ", fingerprint=" + + fingerprint + "]"; + } + + + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPairs.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPairs.java new file mode 100644 index 000000000..d7f8730cc --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPairs.java @@ -0,0 +1,46 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class KeyPairs implements Iterable, Serializable { + + public static final class KeyPairWrapper implements Serializable { + + @JsonProperty + private KeyPair keypair; + + } + + @JsonProperty("keypairs") + private List list; + + /** + * @return the list + */ + public List getList() { + List list = new ArrayList(); + for(KeyPairWrapper wrapper : this.list) { + list.add(wrapper.keypair); + } + return list; + } + + @Override + public Iterator iterator() { + return getList().iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "KeyPairs [list=" + getList() + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Limits.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Limits.java new file mode 100644 index 000000000..5d4e75864 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Limits.java @@ -0,0 +1,394 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Calendar; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@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 maxServerMeta; + private Integer serverMetaUsed; + + private Integer maxPersonality; + private Integer personalityUsed; + + private Integer maxImageMeta; + private Integer imageMetaUsed; + + private Integer maxPersonalitySize; + private Integer personalitySizeUsed; + + private Integer maxTotalCores; + private Integer totalCoresUsed; + + private Integer maxTotalInstances; + private Integer totalInstancesUsed; + + private Integer maxTotalRAMSize; + private Integer totalRAMUsed; + + private Integer maxSecurityGroupRules; + private Integer securityGroupRulesUsed; + + private Integer maxTotalKeypairs; + private Integer totalKeyPairsUsed; + + private Integer maxTotalVolumes; + private Integer totalVolumesUsed; + + private Integer maxSecurityGroups; + private Integer totalSecurityGroupsUsed; + + private Integer maxTotalFloatingIps; + private Integer totalFloatingIpsUsed; + + private Integer maxTotalVolumeGigabytes; + private Integer totalVolumeGigabytesUsed; + + /** + * @return the maxServerMeta + */ + public Integer getMaxServerMeta() { + return maxServerMeta; + } + + /** + * @return the maxPersonality + */ + public Integer getMaxPersonality() { + return maxPersonality; + } + + /** + * @return the maxImageMeta + */ + public Integer getMaxImageMeta() { + return maxImageMeta; + } + + /** + * @return the maxPersonalitySize + */ + public Integer getMaxPersonalitySize() { + return maxPersonalitySize; + } + + /** + * @return the maxTotalCores + */ + public Integer getMaxTotalCores() { + return maxTotalCores; + } + + /** + * @return the maxTotalInstances + */ + public Integer getMaxTotalInstances() { + return maxTotalInstances; + } + + /** + * @return the maxTotalRAMSize + */ + public Integer getMaxTotalRAMSize() { + return maxTotalRAMSize; + } + + /** + * @return the totalVolumesUsed + */ + public Integer getTotalVolumesUsed() { + return totalVolumesUsed; + } + + /** + * @return the maxSecurityGroupRules + */ + public Integer getMaxSecurityGroupRules() { + return maxSecurityGroupRules; + } + + /** + * @return the maxTotalKeypairs + */ + public Integer getMaxTotalKeypairs() { + return maxTotalKeypairs; + } + + /** + * @return the totalCoresUsed + */ + public Integer getTotalCoresUsed() { + return totalCoresUsed; + } + + /** + * @return the maxTotalVolumes + */ + public Integer getMaxTotalVolumes() { + return maxTotalVolumes; + } + + /** + * @return the totalRAMUsed + */ + public Integer getTotalRAMUsed() { + return totalRAMUsed; + } + + /** + * @return the totalInstancesUsed + */ + public Integer getTotalInstancesUsed() { + return totalInstancesUsed; + } + + /** + * @return the maxSecurityGroups + */ + public Integer getMaxSecurityGroups() { + return maxSecurityGroups; + } + + /** + * @return the totalVolumeGigabytesUsed + */ + public Integer getTotalVolumeGigabytesUsed() { + return totalVolumeGigabytesUsed; + } + + /** + * @return the totalSecurityGroupsUsed + */ + public Integer getTotalSecurityGroupsUsed() { + return totalSecurityGroupsUsed; + } + + /** + * @return the maxTotalFloatingIps + */ + public Integer getMaxTotalFloatingIps() { + return maxTotalFloatingIps; + } + + /** + * @return the totalKeyPairsUsed + */ + public Integer getTotalKeyPairsUsed() { + return totalKeyPairsUsed; + } + + /** + * @return the maxTotalVolumeGigabytes + */ + public Integer getMaxTotalVolumeGigabytes() { + return maxTotalVolumeGigabytes; + } + + /** + * @return the serverMetaUsed + */ + public Integer getServerMetaUsed() { + return serverMetaUsed; + } + + /** + * @return the personalityUsed + */ + public Integer getPersonalityUsed() { + return personalityUsed; + } + + /** + * @return the imageMetaUsed + */ + public Integer getImageMetaUsed() { + return imageMetaUsed; + } + + /** + * @return the personalitySizeUsed + */ + public Integer getPersonalitySizeUsed() { + return personalitySizeUsed; + } + + /** + * @return the securityGroupRulesUsed + */ + public Integer getSecurityGroupRulesUsed() { + return securityGroupRulesUsed; + } + + /** + * @return the totalFloatingIpsUsed + */ + public Integer getTotalFloatingIpsUsed() { + return totalFloatingIpsUsed; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "AbsoluteLimit [maxServerMeta=" + maxServerMeta + + ", maxPersonality=" + maxPersonality + ", maxImageMeta=" + + maxImageMeta + ", maxPersonalitySize=" + + maxPersonalitySize + ", maxTotalCores=" + maxTotalCores + + ", maxTotalInstances=" + maxTotalInstances + + ", maxTotalRAMSize=" + maxTotalRAMSize + "]"; + } + + } + + 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/nova-model/src/main/java/com/woorea/openstack/nova/model/Link.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Link.java new file mode 100644 index 000000000..f973bec55 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Link.java @@ -0,0 +1,42 @@ +package com.woorea.openstack.nova.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/nova-model/src/main/java/com/woorea/openstack/nova/model/Metadata.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Metadata.java new file mode 100644 index 000000000..a3dbffb77 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Metadata.java @@ -0,0 +1,26 @@ +package com.woorea.openstack.nova.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; + } + + + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Network.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Network.java new file mode 100644 index 000000000..e842e3d88 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Network.java @@ -0,0 +1,290 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("network") +public class Network implements Serializable { + + private String id; + + @JsonProperty("vpn_public_address") + private String vpnPublicAddress; + + @JsonProperty("vpn_private_address") + private String vpnPrivateAddress; + + @JsonProperty("vpn_public_port") + private String vpnPublicPort; + + @JsonProperty("dhcp_start") + private String dhcpStart; + + private String bridge; + + @JsonProperty("bridge_interface") + private String bridgeInterface; + + @JsonProperty("updated_at") + private String updatedAt; + + private Boolean deleted; + + private String vlan; + + private String broadcast; + + private String netmask; + + private Boolean injected; + + private String host; + + @JsonProperty("multi_host") + private Boolean multiHost; + + @JsonProperty("created_at") + private String createdAt; + + @JsonProperty("deleted_at") + private String deletedAt; + + private String cidr; + + @JsonProperty("cidr_v6") + private String cidrV6; + + private String gateway; + + @JsonProperty("gateway_v6") + private String gatewayV6; + + @JsonProperty("netmask_v6") + private String netmaskV6; + + @JsonProperty("project_id") + private String projectId; + + @JsonProperty("rxtx_base") + private String rxtxBase; + + private String dns1; + + private String dns2; + + private String label; + + private String priority; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the vpnPublicAddress + */ + public String getVpnPublicAddress() { + return vpnPublicAddress; + } + + /** + * @return the vpnPublicPort + */ + public String getVpnPublicPort() { + return vpnPublicPort; + } + + /** + * @return the dhcpStart + */ + public String getDhcpStart() { + return dhcpStart; + } + + /** + * @return the bridge + */ + public String getBridge() { + return bridge; + } + + /** + * @return the bridgeInterface + */ + public String getBridgeInterface() { + return bridgeInterface; + } + + /** + * @return the updatedAt + */ + public String getUpdatedAt() { + return updatedAt; + } + + /** + * @return the deleted + */ + public Boolean getDeleted() { + return deleted; + } + + /** + * @return the vlan + */ + public String getVlan() { + return vlan; + } + + /** + * @return the broadcast + */ + public String getBroadcast() { + return broadcast; + } + + /** + * @return the netmask + */ + public String getNetmask() { + return netmask; + } + + /** + * @return the injected + */ + public Boolean getInjected() { + return injected; + } + + /** + * @return the host + */ + public String getHost() { + return host; + } + + /** + * @return the multiHost + */ + public Boolean getMultiHost() { + return multiHost; + } + + /** + * @return the createdAt + */ + public String getCreatedAt() { + return createdAt; + } + + /** + * @return the deletedAt + */ + public String getDeletedAt() { + return deletedAt; + } + + /** + * @return the cidr + */ + public String getCidr() { + return cidr; + } + + /** + * @return the cidrV6 + */ + public String getCidrV6() { + return cidrV6; + } + + /** + * @return the gateway + */ + public String getGateway() { + return gateway; + } + + /** + * @return the gatewayV6 + */ + public String getGatewayV6() { + return gatewayV6; + } + + /** + * @return the netmaskV6 + */ + public String getNetmaskV6() { + return netmaskV6; + } + + /** + * @return the projectId + */ + public String getProjectId() { + return projectId; + } + + /** + * @return the rxtxBase + */ + public String getRxtxBase() { + return rxtxBase; + } + + /** + * @return the dns1 + */ + public String getDns1() { + return dns1; + } + + /** + * @return the dns2 + */ + public String getDns2() { + return dns2; + } + + /** + * @return the label + */ + public String getLabel() { + return label; + } + + /** + * @return the priority + */ + public String getPriority() { + return priority; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Network [id=" + id + ", vpnPublicAddress=" + vpnPublicAddress + + ", vpnPublicPort=" + vpnPublicPort + ", dhcpStart=" + + dhcpStart + ", bridge=" + bridge + ", bridgeInterface=" + + bridgeInterface + ", updatedAt=" + updatedAt + ", deleted=" + + deleted + ", vlan=" + vlan + ", broadcast=" + broadcast + + ", netmask=" + netmask + ", injected=" + injected + ", host=" + + host + ", multiHost=" + multiHost + ", createdAt=" + + createdAt + ", deletedAt=" + deletedAt + ", cidr=" + cidr + + ", cidrV6=" + cidrV6 + ", gateway=" + gateway + + ", gatewayV6=" + gatewayV6 + ", netmaskV6=" + netmaskV6 + + ", projectId=" + projectId + ", rxtxBase=" + rxtxBase + + ", dns1=" + dns1 + ", dns2=" + dns2 + ", label=" + label + + ", priority=" + priority + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/NetworkForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/NetworkForCreate.java new file mode 100644 index 000000000..d9ce4660a --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/NetworkForCreate.java @@ -0,0 +1,29 @@ +package com.woorea.openstack.nova.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +public class NetworkForCreate { + + @JsonProperty("uuid") + private String id; + @JsonProperty("fixed_ip") + private String fixedIp; + + public String getId() { + return id; + } + + public String getFixedIp() { + return fixedIp; + } + + public void setId(String id) { + this.id = id; + } + + public void setFixedIp(String fixedIp) { + this.fixedIp = fixedIp; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Networks.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Networks.java new file mode 100644 index 000000000..3ac070abe --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Networks.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Networks implements Iterable, Serializable { + + @JsonProperty("networks") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Servers [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/PersonalityFile.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/PersonalityFile.java new file mode 100644 index 000000000..c4ff30715 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/PersonalityFile.java @@ -0,0 +1,39 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +public final class PersonalityFile implements Serializable { + + private String path; + + private String contents; + + /** + * @return the path + */ + public String getPath() { + return path; + } + + /** + * @param path the path to set + */ + public void setPath(String path) { + this.path = path; + } + + /** + * @return the contents + */ + public String getContents() { + return contents; + } + + /** + * @param contents the contents to set + */ + public void setContents(String contents) { + this.contents = contents; + } + +} diff --git a/src/main/java/org/openstack/model/compute/nova/quota/NovaQuotaSet.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/QuotaSet.java similarity index 78% rename from src/main/java/org/openstack/model/compute/nova/quota/NovaQuotaSet.java rename to nova-model/src/main/java/com/woorea/openstack/nova/model/QuotaSet.java index f8be82036..3f142d66b 100644 --- a/src/main/java/org/openstack/model/compute/nova/quota/NovaQuotaSet.java +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/QuotaSet.java @@ -1,12 +1,10 @@ -package org.openstack.model.compute.nova.quota; +package com.woorea.openstack.nova.model; -import java.io.Serializable; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("quota_set") -public class NovaQuotaSet implements Serializable { +public class QuotaSet { private String id; @@ -38,6 +36,12 @@ public class NovaQuotaSet implements Serializable { @JsonProperty("security_group_rules") private Integer securityGroupRules; + @JsonProperty("injected_file_path_bytes") + private Integer injectedFilePathBytes; + + @JsonProperty("key_pairs") + private Integer keyPairs; + public String getId() { return id; } @@ -133,5 +137,20 @@ public Integer getSecurityGroupRules() { public void setSecurityGroupRules(Integer securityGroupRules) { this.securityGroupRules = securityGroupRules; } - -} + + public Integer getKeyPairs() { + return keyPairs; + } + + public void setKeyPairs(Integer keyPairs) { + this.keyPairs = keyPairs; + } + + public Integer getInjectedFilePathBytes() { + return injectedFilePathBytes; + } + + public void setInjectedFilePathBytes(Integer injectedFilePathBytes) { + this.injectedFilePathBytes = injectedFilePathBytes; + } +} \ No newline at end of file diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroup.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroup.java new file mode 100644 index 000000000..2b7c31747 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroup.java @@ -0,0 +1,207 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("security_group") +public class SecurityGroup implements Serializable { + + @JsonRootName("security_group_rule") + public static final class Rule implements Serializable { + + public static final class Group implements Serializable { + + private String name; + + @JsonProperty("tenant_id") + private String tenantId; + + public String getName() { + return name; + } + + public String getTenantId() { + return tenantId; + } + + @Override + public String toString() { + return "Group [name=" + name + ", tenantId=" + tenantId + "]"; + } + + } + + public static final class IpRange implements Serializable { + + private String cidr; + + public String getCidr() { + return cidr; + } + + @Override + public String toString() { + return "IpRange [cidr=" + cidr + "]"; + } + + } + + private String id; + + private String name; + + @JsonProperty("parent_group_id") + private String parentGroupId; + + @JsonProperty("from_port") + private Integer fromPort; + + @JsonProperty("to_port") + private Integer toPort; + + @JsonProperty("ip_protocol") + private String ipProtocol; + + @JsonProperty("ip_range") + private IpRange ipRange = new IpRange(); + + private Group group; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the parentGroupId + */ + public String getParentGroupId() { + return parentGroupId; + } + + /** + * @return the fromPort + */ + public Integer getFromPort() { + return fromPort; + } + + /** + * @return the toPort + */ + public Integer getToPort() { + return toPort; + } + + /** + * @return the ipProtocol + */ + public String getIpProtocol() { + return ipProtocol; + } + + /** + * @return the ipRange + */ + public IpRange getIpRange() { + return ipRange; + } + + /** + * @return the group + */ + public Group getGroup() { + return group; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Rule [id=" + id + ", name=" + name + ", parentGroupId=" + + parentGroupId + ", fromPort=" + fromPort + ", toPort=" + + toPort + ", ipProtocol=" + ipProtocol + ", ipRange=" + + ipRange + ", group=" + group + "]"; + } + + } + + private String id; + + private String name; + + private String description; + + @JsonProperty("tenant_id") + private String tenantId; + + private List rules; + + private List links; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @return the rules + */ + public List getRules() { + return rules; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "SecurityGroup [id=" + id + ", name=" + name + ", description=" + + description + ", tenantId=" + tenantId + ", rules=" + rules + + ", links=" + links + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupForCreate.java new file mode 100644 index 000000000..17376f6b9 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupForCreate.java @@ -0,0 +1,64 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("security_group") +public class SecurityGroupForCreate implements Serializable { + + private String name; + + private String description; + + public SecurityGroupForCreate() { + super(); + } + + public SecurityGroupForCreate(String name) { + this.name = name; + } + + public SecurityGroupForCreate(String name, String description) { + this(name); + this.description = 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 "SecurityGroupForCreate [name=" + name + ", description=" + + description + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupRuleForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupRuleForCreate.java new file mode 100644 index 000000000..12c9851b3 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupRuleForCreate.java @@ -0,0 +1,198 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlElement; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("security_group_rule") +public class SecurityGroupRuleForCreate implements Serializable { + + @JsonProperty("parent_group_id") + private String parentGroupId; + + @JsonProperty("ip_protocol") + private String ipProtocol; + + @JsonProperty("from_port") + private Integer fromPort; + + @JsonProperty("to_port") + private Integer toPort; + + @XmlElement + private String cidr; + + @JsonProperty("group_id") + private String groupId; + + public SecurityGroupRuleForCreate() { + + } + + /** + * + * @param parentSecurityGroupId + * @param ipProtocol + * @param fromPort + * @param toPort + * @param cidr + * @deprecated Ids in some installs have shown to use strings .Use {@link #SecurityGroupRuleForCreate(String, String, Integer, Integer, String)} + */ + @Deprecated + public SecurityGroupRuleForCreate(Integer parentSecurityGroupId, String ipProtocol, Integer fromPort,Integer toPort, String cidr) { + this.parentGroupId = String.valueOf(parentSecurityGroupId); + this.ipProtocol = ipProtocol; + this.fromPort = fromPort; + this.toPort = toPort; + this.cidr = cidr; + } + /** + * + * @param parentGroupId + * @param ipProtocol + * @param fromPort + * @param toPort + * @param sourceGroupId + * @deprecated Ids in some installs have shown to use strings .Use {@link #SecurityGroupRuleForCreate(String, String, String, Integer, Integer)} + */ + @Deprecated + public SecurityGroupRuleForCreate(Integer parentGroupId, String ipProtocol, Integer fromPort,Integer toPort, Integer sourceGroupId) { + this.parentGroupId = String.valueOf(parentGroupId); + this.ipProtocol = ipProtocol; + this.fromPort = fromPort; + this.toPort = toPort; + this.groupId = String.valueOf(sourceGroupId); + } + + public SecurityGroupRuleForCreate(String parentSecurityGroupId, String ipProtocol, Integer fromPort,Integer toPort, String cidr) { + this.parentGroupId = parentSecurityGroupId; + this.ipProtocol = ipProtocol; + this.fromPort = fromPort; + this.toPort = toPort; + this.cidr = cidr; + } + + public SecurityGroupRuleForCreate(String parentGroupId, String sourceGroupId, String ipProtocol, Integer fromPort,Integer toPort) { + this.parentGroupId = parentGroupId; + this.ipProtocol = ipProtocol; + this.fromPort = fromPort; + this.toPort = toPort; + this.groupId = sourceGroupId; + } + + /** + * @return the parentGroupId + */ + public String getParentGroupId() { + return parentGroupId; + } + + + /** + * @param parentGroupId the parentGroupId to set + * @deprecated Use {@link #setParentGroupId(String)} + */ + public void setParentGroupId(Integer parentGroupId) { + this.parentGroupId = String.valueOf(parentGroupId); + } + + /** + * @param parentGroupId the parentGroupId to set + */ + public void setParentGroupId(String parentGroupId) { + this.parentGroupId = parentGroupId; + } + + /** + * @return the fromPort + */ + public Integer getFromPort() { + return fromPort; + } + + /** + * @param fromPort the fromPort to set + */ + public void setFromPort(Integer fromPort) { + this.fromPort = fromPort; + } + + /** + * @return the toPort + */ + public Integer getToPort() { + return toPort; + } + + /** + * @param toPort the toPort to set + */ + public void setToPort(Integer toPort) { + this.toPort = toPort; + } + + /** + * @return the ipProtocol + */ + public String getIpProtocol() { + return ipProtocol; + } + + /** + * @param ipProtocol the ipProtocol to set + */ + public void setIpProtocol(String ipProtocol) { + this.ipProtocol = ipProtocol; + } + + /** + * @return the cidr + */ + public String getCidr() { + return cidr; + } + + /** + * @param cidr the cidr to set + */ + public void setCidr(String cidr) { + this.cidr = cidr; + } + + /** + * @return the groupId + */ + public String getGroupId() { + return groupId; + } + + /** + * @param groupId the groupId to set + * @deprecated Use {@link #setGroupId(String)} + */ + public void setGroupId(Integer groupId) { + this.groupId = String.valueOf(groupId); + } + + /** + * @param groupId the groupId to set + */ + public void setGroupId(String groupId) { + this.groupId = groupId; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "SecurityGroupRuleForCreate [parentGroupId=" + parentGroupId + + ", fromPort=" + fromPort + ", toPort=" + toPort + + ", ipProtocol=" + ipProtocol + ", cidr=" + cidr + + ", groupId=" + groupId + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroups.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroups.java new file mode 100644 index 000000000..84a0096fe --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroups.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class SecurityGroups implements Iterable, Serializable { + + @JsonProperty("security_groups") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "SecurityGroups [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java new file mode 100644 index 000000000..229b3329e --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Server.java @@ -0,0 +1,514 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("server") +public class Server implements Serializable { + + public static final class Addresses implements Serializable { + + public static final class Address implements Serializable { + + @JsonProperty("OS-EXT-IPS-MAC:mac_addr") + private String macAddr; + + private String version; + + private String addr; + + @JsonProperty("OS-EXT-IPS:type") + private String type; + + /** + * @return the macAddr + */ + public String getMacAddr() { + return macAddr; + } + + /** + * @return the version + */ + public String getVersion() { + return version; + } + + /** + * @return the addr + */ + public String getAddr() { + return addr; + } + + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param version the version to set + */ + public void setVersion(String version) { + this.version = version; + } + + /** + * @param addr the addr to set + */ + public void setAddr(String addr) { + this.addr = addr; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @param macAddr the mac addr to set + */ + public void setMacAddr(String macAddr) { + this.macAddr= macAddr; + } + } + + private Map> addresses = new HashMap>(); + + @JsonAnySetter + public void add(String key, List
value) { + addresses.put(key, value); + } + /** + * @return the ip address List Map + */ + public Map> getAddresses() { + return addresses; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Addresses List Map [" + addresses + "]"; + } + + } + + public static final class Fault { + + private Integer code; + + private String message; + + private String details; + + private Calendar created; + + /** + * @return the code + */ + public Integer getCode() { + return code; + } + + /** + * @return the message + */ + public String getMessage() { + return message; + } + + /** + * @return the details + */ + public String getDetails() { + return details; + } + + /** + * @return the created + */ + public Calendar getCreated() { + return created; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Fault [code=" + code + ", message=" + message + + ", details=" + details + ", created=" + created + "]"; + } + + + } + + + private String id; + + private String name; + + private Addresses addresses; + + private List links; + + private Image image; + + private Flavor flavor; + + private String accessIPv4; + + private String accessIPv6; + + @JsonProperty("config_drive") + private String configDrive; + + private String status; + + private Integer progress; + + private Fault fault; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("user_id") + private String userId; + + @JsonProperty("key_name") + private String keyName; + + private String hostId; + + private String updated; + + private String created; + + private Map metadata; + + @JsonProperty("security_groups") + private List securityGroups; + + @JsonProperty("OS-EXT-STS:task_state") + private String taskState; + + @JsonProperty("OS-EXT-STS:power_state") + private String powerState; + + @JsonProperty("OS-EXT-STS:vm_state") + private String vmState; + + @JsonProperty("OS-EXT-SRV-ATTR:host") + private String host; + + @JsonProperty("OS-EXT-SRV-ATTR:instance_name") + private String instanceName; + + @JsonProperty("OS-EXT-SRV-ATTR:hypervisor_hostname") + private String hypervisorHostname; + + @JsonProperty("OS-DCF:diskConfig") + private String diskConfig; + + @JsonProperty("OS-EXT-AZ:availability_zone") + private String availabilityZone; + + @JsonProperty("OS-SRV-USG:launched_at") + private String launchedAt; + + @JsonProperty("OS-SRV-USG:terminated_at") + private String terminatedAt; + + @JsonProperty("os-extended-volumes:volumes_attached") + private List osExtendedVolumesAttached; + + private String uuid; + + private String adminPass; + + /** + * @return the id + */ + public String getId() { + return id; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @return the addresses + */ + public Addresses getAddresses() { + return addresses; + } + + /** + * @return the links + */ + public List getLinks() { + return links; + } + + /** + * @return the image + */ + public Image getImage() { + return image; + } + + /** + * @param image the image to set + */ + public void setImage(Image image) { + this.image = image; + } + + /** + * @return the flavor + */ + public Flavor getFlavor() { + return flavor; + } + + /** + * @param flavor the flavor to set + */ + public void setFlavor(Flavor flavor) { + this.flavor = flavor; + } + + /** + * @return the accessIPv4 + */ + public String getAccessIPv4() { + return accessIPv4; + } + + /** + * @return the accessIPv6 + */ + public String getAccessIPv6() { + return accessIPv6; + } + + /** + * @return the configDrive + */ + public String getConfigDrive() { + return configDrive; + } + + /** + * @return the status + */ + public String getStatus() { + return status; + } + + /** + * @return the progress + */ + public Integer getProgress() { + return progress; + } + + /** + * @return the fault + */ + public Fault getFault() { + return fault; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @return the userId + */ + public String getUserId() { + return userId; + } + + /** + * @return the keyName + */ + public String getKeyName() { + return keyName; + } + + /** + * @return the hostId + */ + public String getHostId() { + return hostId; + } + + /** + * @return the updated + */ + public String getUpdated() { + return updated; + } + + /** + * @return the created + */ + public String getCreated() { + return created; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * @return the securityGroups + */ + public List getSecurityGroups() { + return securityGroups; + } + + /** + * @return the taskState + */ + public String getTaskState() { + return taskState; + } + + /** + * @return the powerState + */ + public String getPowerState() { + return powerState; + } + + /** + * @return the vmState + */ + public String getVmState() { + return vmState; + } + + /** + * @return the host + */ + public String getHost() { + return host; + } + + /** + * @return the instanceName + */ + public String getInstanceName() { + return instanceName; + } + + /** + * @return the hypervisorHostname + */ + public String getHypervisorHostname() { + return hypervisorHostname; + } + + /** + * @return the diskConfig + */ + public String getDiskConfig() { + return diskConfig; + } + + /** + * @return the availabilityZone + */ + public String getAvailabilityZone() { + return availabilityZone; + } + + /** + * @return the launchedAt + */ + public String getLaunchedAt() { + return launchedAt; + } + + /** + * @return the terminatedAt + */ + public String getTerminatedAt() { + return terminatedAt; + } + + /** + * @return the osExtendedVolumesAttached + */ + public List getOsExtendedVolumesAttached() { + return osExtendedVolumesAttached; + } + + /** + * @return the uuid + */ + public String getUuid() { + return uuid; + } + + /** + * @return the adminPass + */ + public String getAdminPass() { + return adminPass; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Server [id=" + id + ", name=" + name + ", addresses=" + + addresses + ", links=" + links + ", image=" + image + + ", flavor=" + flavor + ", accessIPv4=" + accessIPv4 + + ", accessIPv6=" + accessIPv6 + ", configDrive=" + configDrive + + ", status=" + status + ", progress=" + progress + ", fault=" + + fault + ", tenantId=" + tenantId + ", userId=" + userId + + ", keyName=" + keyName + ", hostId=" + hostId + ", updated=" + + updated + ", created=" + created + ", metadata=" + metadata + + ", securityGroups=" + securityGroups + ", taskState=" + + taskState + ", powerState=" + powerState + ", vmState=" + + vmState + ", host=" + host + ", instanceName=" + instanceName + + ", hypervisorHostname=" + hypervisorHostname + + ", diskConfig=" + diskConfig + ", availabilityZone=" + + availabilityZone + ", launchedAt=" + launchedAt + ", terminatedAt=" + + ", " + "osExtendedVolumesAttached=" + osExtendedVolumesAttached + + ", uuid=" + uuid + ", adminPass=" + + adminPass + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerAction.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerAction.java new file mode 100644 index 000000000..161eb6a76 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerAction.java @@ -0,0 +1,610 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +public interface ServerAction extends Serializable { + + @JsonRootName("changePassword") + public static final class ChangePassword implements ServerAction { + + private String adminPass; + + public ChangePassword() { + super(); + // TODO Auto-generated constructor stub + } + + public ChangePassword(String adminPass) { + this.adminPass = adminPass; + } + + /** + * @return the adminPass + */ + public String getAdminPass() { + return adminPass; + } + + /** + * @param adminPass the adminPass to set + */ + public void setAdminPass(String adminPass) { + this.adminPass = adminPass; + } + + } + + @JsonRootName("reboot") + public static final class Reboot implements ServerAction { + + private String type; + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + } + + @JsonRootName("rebuild") + public static final class Rebuild implements ServerAction { + + private String imageRef; + + private String name; + + private String adminPass; + + private String accessIPv4; + + private String accessIPv6; + + private Map metadata = new HashMap(); + + private List personality = new ArrayList(); + + @JsonProperty("OS-DCF:diskConfig") + private String diskConfig; + + /** + * @return the imageRef + */ + public String getImageRef() { + return imageRef; + } + + /** + * @param imageRef the imageRef to set + */ + public void setImageRef(String imageRef) { + this.imageRef = imageRef; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the adminPass + */ + public String getAdminPass() { + return adminPass; + } + + /** + * @param adminPass the adminPass to set + */ + public void setAdminPass(String adminPass) { + this.adminPass = adminPass; + } + + /** + * @return the accessIPv4 + */ + public String getAccessIPv4() { + return accessIPv4; + } + + /** + * @param accessIPv4 the accessIPv4 to set + */ + public void setAccessIPv4(String accessIPv4) { + this.accessIPv4 = accessIPv4; + } + + /** + * @return the accessIPv6 + */ + public String getAccessIPv6() { + return accessIPv6; + } + + /** + * @param accessIPv6 the accessIPv6 to set + */ + public void setAccessIPv6(String accessIPv6) { + this.accessIPv6 = accessIPv6; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * @param metadata the metadata to set + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + /** + * @return the personality + */ + public List getPersonality() { + return personality; + } + + /** + * @param personality the personality to set + */ + public void setPersonality(List personality) { + this.personality = personality; + } + + /** + * @return the diskConfig + */ + public String getDiskConfig() { + return diskConfig; + } + + /** + * @param diskConfig the diskConfig to set + */ + public void setDiskConfig(String diskConfig) { + this.diskConfig = diskConfig; + } + + } + + @JsonRootName("resize") + public static final class Resize implements ServerAction { + + private String flavorRef; + + @JsonProperty("OS-DCF:diskConfig") + private String diskConfig; + + /** + * @return the flavorRef + */ + public String getFlavorRef() { + return flavorRef; + } + + /** + * @param flavorRef the flavorRef to set + */ + public void setFlavorRef(String flavorRef) { + this.flavorRef = flavorRef; + } + + /** + * @return the diskConfig + */ + public String getDiskConfig() { + return diskConfig; + } + + /** + * @param diskConfig the diskConfig to set + */ + public void setDiskConfig(String diskConfig) { + this.diskConfig = diskConfig; + } + + } + + @JsonRootName("confirmResize") + public static final class ConfirmResize implements ServerAction { + + } + + @JsonRootName("revertResize") + public static final class RevertResize implements ServerAction { + + } + + @JsonRootName("createImage") + public static final class CreateImage implements ServerAction { + + private String name; + + private Map metadata; + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * @param metadata the metadata to set + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + } + + @JsonRootName("rescue") + public static final class Rescue implements ServerAction { + + private String adminPass; + + public Rescue() { + + } + + public Rescue(String adminPass) { + this.adminPass = adminPass; + } + + /** + * @return the adminPass + */ + public String getAdminPass() { + return adminPass; + } + + /** + * @param adminPass the adminPass to set + */ + public void setAdminPass(String adminPass) { + this.adminPass = adminPass; + } + + } + + public static final class RescueResponse implements ServerAction { + + private String adminPass; + + /** + * @return the adminPass + */ + public String getAdminPass() { + return adminPass; + } + + } + + @JsonRootName("unrescue") + public static final class Unrescue implements ServerAction { + + } + + @JsonRootName("unpause") + public static final class Unpause implements ServerAction { + + } + + @JsonRootName("pause") + public static final class Pause implements ServerAction { + + } + + @JsonRootName("suspend") + public static final class Suspend implements ServerAction { + + } + + @JsonRootName("resume") + public static final class Resume implements ServerAction { + + } + + @JsonRootName("lock") + public static final class Lock implements ServerAction { + + } + + @JsonRootName("unlock") + public static final class Unlock implements ServerAction { + + } + + @JsonRootName("os-getConsoleOutput") + public static final class GetConsoleOutput implements ServerAction { + + private Integer length; + + public GetConsoleOutput() { + + } + + public GetConsoleOutput(Integer length) { + this.length = length; + } + + /** + * @return the length + */ + public Integer getLength() { + return length; + } + + /** + * @param length the length to set + */ + public void setLength(Integer length) { + this.length = length; + } + + } + + public static final class ConsoleOutput implements ServerAction { + + private String output; + + /** + * @return the output + */ + public String getOutput() { + return output; + } + + } + + @JsonRootName("os-getVNCConsole") + public static final class GetVncConsole implements ServerAction { + + private String type; + + public GetVncConsole() { + super(); + // TODO Auto-generated constructor stub + } + + + public GetVncConsole(String type) { + super(); + this.type = type; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + } + + @JsonRootName("console") + public static final class VncConsole implements ServerAction { + + private String type; + + private String url; + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @return the url + */ + public String getUrl() { + return url; + } + + } + + @JsonRootName("os-start") + public static final class Start implements ServerAction { + + } + + @JsonRootName("os-stop") + public static final class Stop implements ServerAction { + + } + + @JsonRootName("forceDelete") + public static final class ForceDelete implements ServerAction { + + } + + @JsonRootName("restore") + public static final class Restore implements ServerAction { + + } + + @JsonRootName("addFloatingIp") + public static final class AssociateFloatingIp implements ServerAction { + + private String address; + + public AssociateFloatingIp() { + super(); + // TODO Auto-generated constructor stub + } + + public AssociateFloatingIp(String address) { + super(); + this.address = address; + } + + /** + * @return the address + */ + public String getAddress() { + return address; + } + + /** + * @param address the address to set + */ + public void setAddress(String address) { + this.address = address; + } + + } + + @JsonRootName("removeFloatingIp") + public static final class DisassociateFloatingIp implements ServerAction { + + private String address; + + public DisassociateFloatingIp() { + super(); + // TODO Auto-generated constructor stub + } + + public DisassociateFloatingIp(String address) { + super(); + this.address = address; + } + + /** + * @return the address + */ + public String getAddress() { + return address; + } + + /** + * @param address the address to set + */ + public void setAddress(String address) { + this.address = address; + } + + } + + @JsonRootName("createBackup") + public static final class CreateBackup implements ServerAction { + + private String name; + + @JsonProperty("backup_type") + private String type; + + private String rotation; + + private Map metadata; + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the type + */ + public String getType() { + return type; + } + + /** + * @param type the type to set + */ + public void setType(String type) { + this.type = type; + } + + /** + * @return the rotation + */ + public String getRotation() { + return rotation; + } + + /** + * @param rotation the rotation to set + */ + public void setRotation(String rotation) { + this.rotation = rotation; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * @param metadata the metadata to set + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerForCreate.java new file mode 100644 index 000000000..8b50774a0 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/ServerForCreate.java @@ -0,0 +1,326 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("server") +public class ServerForCreate implements Serializable { + + public static final class SecurityGroup implements Serializable { + + private String name; + + public SecurityGroup() { + } + + public SecurityGroup(String name) { + this.name = name; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + } + + private String name; + + private String adminPass; + + private String imageRef; + + private String flavorRef; + + private String accessIPv4; + + private String accessIPv6; + + private Integer min; + + private Integer max; + + private String diskConfig; + + @JsonProperty("key_name") + private String keyName; + + private List personality = new ArrayList(); + + private Map metadata = new HashMap(); + + @JsonProperty("security_groups") + private List securityGroups; + + @JsonProperty("user_data") + private String userData; + + @JsonProperty("availability_zone") + private String availabilityZone; + + @JsonProperty("config_drive") + private boolean configDrive; + + @JsonProperty("networks") + private List networks = new ArrayList(); + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the adminPass + */ + public String getAdminPass() { + return adminPass; + } + + /** + * @param adminPass + * the adminPass to set + */ + public void setAdminPass(String adminPass) { + this.adminPass = adminPass; + } + + /** + * @return the imageRef + */ + public String getImageRef() { + return imageRef; + } + + /** + * @param imageRef + * the imageRef to set + */ + public void setImageRef(String imageRef) { + this.imageRef = imageRef; + } + + /** + * @return the flavorRef + */ + public String getFlavorRef() { + return flavorRef; + } + + /** + * @param flavorRef + * the flavorRef to set + */ + public void setFlavorRef(String flavorRef) { + this.flavorRef = flavorRef; + } + + /** + * @return the accessIPv4 + */ + public String getAccessIPv4() { + return accessIPv4; + } + + /** + * @param accessIPv4 + * the accessIPv4 to set + */ + public void setAccessIPv4(String accessIPv4) { + this.accessIPv4 = accessIPv4; + } + + /** + * @return the accessIPv6 + */ + public String getAccessIPv6() { + return accessIPv6; + } + + /** + * @param accessIPv6 + * the accessIPv6 to set + */ + public void setAccessIPv6(String accessIPv6) { + this.accessIPv6 = accessIPv6; + } + + /** + * @return the min + */ + public Integer getMin() { + return min; + } + + /** + * @param min + * the min to set + */ + public void setMin(Integer min) { + this.min = min; + } + + /** + * @return the max + */ + public Integer getMax() { + return max; + } + + /** + * @param max + * the max to set + */ + public void setMax(Integer max) { + this.max = max; + } + + /** + * @return the diskConfig + */ + public String getDiskConfig() { + return diskConfig; + } + + /** + * @param diskConfig + * the diskConfig to set + */ + public void setDiskConfig(String diskConfig) { + this.diskConfig = diskConfig; + } + + /** + * @return the keyName + */ + public String getKeyName() { + return keyName; + } + + /** + * @param keyName + * the keyName to set + */ + public void setKeyName(String keyName) { + this.keyName = keyName; + } + + /** + * @return the personality + */ + public List getPersonality() { + return personality; + } + + /** + * @param personality + * the personality to set + */ + public void setPersonality(List personality) { + this.personality = personality; + } + + /** + * @return the metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * @param metadata + * the metadata to set + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + /** + * @return the securityGroups + */ + public List getSecurityGroups() { + if (securityGroups == null) { + securityGroups = new ArrayList(); + } + return securityGroups; + } + + /** + * @return the userData + */ + public String getUserData() { + return userData; + } + + /** + * @param userData + * the userData to set + */ + public void setUserData(String userData) { + this.userData = userData; + } + + /** + * @return the availabilityZone + */ + public String getAvailabilityZone() { + return availabilityZone; + } + + /** + * @param availabilityZone + * the availabilityZone to set + */ + public void setAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public boolean isConfigDrive() { + return configDrive; + } + + public void setConfigDrive(boolean configDrive) { + this.configDrive = configDrive; + } + + public List getNetworks() { + return networks; + } + + public void setNetworks(List networks) { + this.networks = networks; + } + + public void addNetworks(String id, String fixedIp) { + NetworkForCreate net = new NetworkForCreate(); + net.setId(id); + net.setFixedIp(fixedIp); + this.networks.add(net); + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Servers.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Servers.java new file mode 100644 index 000000000..e6a5907d1 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Servers.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Servers implements Iterable, Serializable { + + @JsonProperty("servers") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Servers [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Service.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Service.java new file mode 100644 index 000000000..7a673e78e --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Service.java @@ -0,0 +1,95 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +/** + * Model for Service + * + */ +@JsonRootName("service") +public class Service implements Serializable { + + private String status; + private String binary; + private String zone; + private String state; + private String host; + + @JsonProperty("updated_at") + private String updatedAt; + + @JsonProperty("disabled_reason") + private String disabledReason; + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getBinary() { + return binary; + } + + public void setBinary(String binary) { + this.binary = binary; + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + public String getDisabledReason() { + return disabledReason; + } + + public void setDisabledReason(String disabledReason) { + this.disabledReason = disabledReason; + } + + @Override + public String toString() { + return "Service {" + + "host='" + host + + ", state='" + state + + ", status='" + status + + ", zone='" + zone + + ", binary='" + binary + + ", updated_at='" + updatedAt + + ", disabled_reason='" + disabledReason + + '}'; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Services.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Services.java new file mode 100644 index 000000000..797a5fb70 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Services.java @@ -0,0 +1,33 @@ +package com.woorea.openstack.nova.model; + +import java.util.Iterator; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Model for List of Services + * + */ +public class Services implements Iterable { + + @JsonProperty("services") + 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 "Services [list=" + list + "]"; + } +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/SimpleTenantUsage.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/SimpleTenantUsage.java new file mode 100644 index 000000000..31b49a0a9 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/SimpleTenantUsage.java @@ -0,0 +1,232 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("tenant_usage") +public class SimpleTenantUsage implements Serializable { + + @JsonProperty("total_memory_mb_usage") + private BigDecimal totalMemoryMbUsage; + + @JsonProperty("total_vcpus_usage") + private BigDecimal totalVcpusUsage; + + @JsonProperty("total_local_gb_usage") + private BigDecimal totalLocalGbUsage; + + private String start; + + private String stop; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("total_hours") + private String totalHours; + + @JsonProperty("server_usages") + private List serverUsages; + + /** + * @return the totalMemoryMbUsage + */ + public BigDecimal getTotalMemoryMbUsage() { + return totalMemoryMbUsage; + } + + /** + * @param totalMemoryMbUsage the totalMemoryMbUsage to set + */ + public void setTotalMemoryMbUsage(BigDecimal totalMemoryMbUsage) { + this.totalMemoryMbUsage = totalMemoryMbUsage; + } + + /** + * @return the totalVcpusUsage + */ + public BigDecimal getTotalVcpusUsage() { + return totalVcpusUsage; + } + + /** + * @param totalVcpusUsage the totalVcpusUsage to set + */ + public void setTotalVcpusUsage(BigDecimal totalVcpusUsage) { + this.totalVcpusUsage = totalVcpusUsage; + } + + /** + * @return the totalLocalGbUsage + */ + public BigDecimal getTotalLocalGbUsage() { + return totalLocalGbUsage; + } + + /** + * @param totalLocalGbUsage the totalLocalGbUsage to set + */ + public void setTotalLocalGbUsage(BigDecimal totalLocalGbUsage) { + this.totalLocalGbUsage = totalLocalGbUsage; + } + + /** + * @return the start + */ + public String getStart() { + return start; + } + + /** + * @param start the start to set + */ + public void setStart(String start) { + this.start = start; + } + + /** + * @return the stop + */ + public String getStop() { + return stop; + } + + /** + * @param stop the stop to set + */ + public void setStop(String stop) { + this.stop = stop; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @param tenantId the tenantId to set + */ + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * @return the totalHours + */ + public String getTotalHours() { + return totalHours; + } + + /** + * @param totalHours the totalHours to set + */ + public void setTotalHours(String totalHours) { + this.totalHours = totalHours; + } + + public List getServerUsages() { + return serverUsages; + } + + public void setServerUsages(List serverUsages) { + this.serverUsages = serverUsages; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "SimpleTenantUsage [totalMemoryMbUsage=" + totalMemoryMbUsage + + ", totalVcpusUsage=" + totalVcpusUsage + + ", totalLocalGbUsage=" + totalLocalGbUsage + ", start=" + + start + ", stop=" + stop + ", tenantId=" + tenantId + + ", totalHours=" + totalHours + "]"; + } + + public static final class ServerUsage implements Serializable { + @JsonProperty("instance_id") + private String instanceId; + + private Integer uptime; + + @JsonProperty("started_at") + private String startedAt; + + @JsonProperty("ended_at") + private String endedAt; + + @JsonProperty("memory_mb") + private Integer memoryMb; + + @JsonProperty("tenant_id") + private String tenantId; + + private String state; + + private Double hours; + + private Integer vcpus; + + private String flavor; + + @JsonProperty("local_gb") + private Integer localDiskSize; + + private String name; + + public String getInstanceId() { + return instanceId; + } + + public Integer getUptime() { + return uptime; + } + + public String getStartedAt() { + return startedAt; + } + + public String getEndedAt() { + return endedAt; + } + + public Integer getMemoryMb() { + return memoryMb; + } + + public String getTenantId() { + return tenantId; + } + + public String getState() { + return state; + } + + public Double getHours() { + return hours; + } + + public Integer getVcpus() { + return vcpus; + } + + public String getFlavor() { + return flavor; + } + + public Integer getLocalDiskSize() { + return localDiskSize; + } + + public String getName() { + return name; + } + } +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/SimpleTenantUsages.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/SimpleTenantUsages.java new file mode 100644 index 000000000..d5b9e9c66 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/SimpleTenantUsages.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class SimpleTenantUsages implements Iterable, Serializable { + + @JsonProperty("tenant_usages") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "SimpleTenantUsage [list=" + list + "]"; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Snapshot.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Snapshot.java new file mode 100644 index 000000000..fb84a1755 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Snapshot.java @@ -0,0 +1,87 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +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; + + @JsonProperty("displayName") + private String name; + + @JsonProperty("displayDescription") + private String description; + + private String volumeId; + + private Integer size; + + private String createdAt; + + /** + * @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; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Snapshot [id=" + id + ", status=" + status + ", displayName=" + + name + ", displayDescription=" + description + + ", volumeId=" + volumeId + ", size=" + size + ", createdAt=" + + createdAt + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/SnapshotForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/SnapshotForCreate.java new file mode 100644 index 000000000..9f90d6bfb --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/SnapshotForCreate.java @@ -0,0 +1,87 @@ +package com.woorea.openstack.nova.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; + + @JsonProperty("display_name") + private String name; + + @JsonProperty("display_description") + 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/nova-model/src/main/java/com/woorea/openstack/nova/model/Snapshots.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Snapshots.java new file mode 100644 index 000000000..00f45f1e6 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Snapshots.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.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/nova-model/src/main/java/com/woorea/openstack/nova/model/Volume.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Volume.java new file mode 100644 index 000000000..7498dcf3b --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Volume.java @@ -0,0 +1,116 @@ +package com.woorea.openstack.nova.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; + +@JsonRootName("volume") +public class Volume implements Serializable { + + private String id; + + private String status; + + @JsonProperty("displayName") + private String name; + + @JsonProperty("displayDescription") + private String description; + + private String availabilityZone; + + private String volumeType; + + private String snapshotId; + + private List> attachments; + + private Map metadata; + + 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 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; + } + + + +} diff --git a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeAttachment.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeAttachment.java similarity index 62% rename from src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeAttachment.java rename to nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeAttachment.java index 3a624782f..6db93bbb4 100644 --- a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeAttachment.java +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeAttachment.java @@ -1,18 +1,18 @@ -package org.openstack.model.compute.nova.volume; +package com.woorea.openstack.nova.model; import java.io.Serializable; -import org.codehaus.jackson.map.annotate.JsonRootName; +import com.fasterxml.jackson.annotation.JsonRootName; @JsonRootName("volumeAttachment") -public class NovaVolumeAttachment implements Serializable { +public class VolumeAttachment implements Serializable { private String id; - + private String volumeId; - + private String serverId; - + private String device; public String getId() { @@ -46,5 +46,14 @@ public String getDevice() { public void setDevice(String device) { this.device = device; } - + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "VolumeAttachment [id=" + id + ", volumeId=" + volumeId + + ", serverId=" + serverId + ", device=" + device + "]"; + } + } diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeAttachments.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeAttachments.java new file mode 100644 index 000000000..20f248d85 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeAttachments.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class VolumeAttachments implements Iterable, Serializable { + + @JsonProperty("volumeAttachments") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "VolumeAttachments [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeForCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeForCreate.java new file mode 100644 index 000000000..1f8f26708 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeForCreate.java @@ -0,0 +1,123 @@ +package com.woorea.openstack.nova.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 Integer snapshotId; + + 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 Integer getSnapshotId() { + return snapshotId; + } + + /** + * @param snapshotId the snapshotId to set + */ + public void setSnapshotId(Integer snapshotId) { + this.snapshotId = snapshotId; + } + + /** + * @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 + ", metadata=" + + metadata + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeForImageCreate.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeForImageCreate.java new file mode 100644 index 000000000..d4ee00646 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeForImageCreate.java @@ -0,0 +1,71 @@ +package com.woorea.openstack.nova.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/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeType.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeType.java new file mode 100644 index 000000000..bd1b30efd --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeType.java @@ -0,0 +1,10 @@ +package com.woorea.openstack.nova.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("volume-type") +public class VolumeType implements Serializable { + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeTypes.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeTypes.java new file mode 100644 index 000000000..3c51d75c5 --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/VolumeTypes.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.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; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "VolumeTypes [list=" + list + "]"; + } + +} diff --git a/nova-model/src/main/java/com/woorea/openstack/nova/model/Volumes.java b/nova-model/src/main/java/com/woorea/openstack/nova/model/Volumes.java new file mode 100644 index 000000000..de662355c --- /dev/null +++ b/nova-model/src/main/java/com/woorea/openstack/nova/model/Volumes.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.nova.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/openstack-client-connectors/jersey-connector/pom.xml b/openstack-client-connectors/jersey-connector/pom.xml new file mode 100644 index 000000000..1b2ee1960 --- /dev/null +++ b/openstack-client-connectors/jersey-connector/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + com.woorea + openstack-client-connectors + 3.2.10-SNAPSHOT + + jersey-connector + OpenStack Jersey Connector + OpenStack Jersey Connector + + + com.sun.jersey + jersey-client + 1.17.1 + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + 2.9.8 + + + diff --git a/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java new file mode 100644 index 000000000..117f64340 --- /dev/null +++ b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyConnector.java @@ -0,0 +1,102 @@ +package com.woorea.openstack.connector; + +import java.util.List; +import java.util.Map; + +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.annotation.JsonRootName; + +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.UniformInterfaceException; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.api.client.filter.LoggingFilter; +import com.sun.jersey.client.impl.ClientRequestImpl; +import com.sun.jersey.core.header.OutBoundHeaders; +import com.woorea.openstack.base.client.OpenStackClientConnector; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.base.client.OpenStackResponse; +import com.woorea.openstack.base.client.OpenStackResponseException; + +public class JerseyConnector implements OpenStackClientConnector { + + protected Client client = null; + + public JerseyConnector() { + ClientConfig clientConfig = new DefaultClientConfig(); + clientConfig.getClasses().add(JacksonJaxbJsonProvider.class); + clientConfig.getClasses().add(OpenStackObjectMapper.class); + client = Client.create(clientConfig); + } + + @Override + public OpenStackResponse request(OpenStackRequest request) { + WebResource target = client.resource(request.endpoint()).path(request.path()); + for(Map.Entry > entry : request.queryParams().entrySet()) { + for (Object o : entry.getValue()) { + target = target.queryParam(entry.getKey(), String.valueOf(o)); + } + } + target.addFilter(new LoggingFilter()); + MultivaluedMap headers = new OutBoundHeaders(); + for(Map.Entry> h : request.headers().entrySet()) { + for(Object v : h.getValue()) { + headers.add(h.getKey(), v); + } + } + if(request.entity() != null && request.entity().getContentType() != null) { + headers.add("Content-Type", request.entity().getContentType()); + } else { + headers.add("Content-Type", "application/json"); + } + try { + ClientResponse response = null; + if (request.entity() != null && request.entity().getEntity() != null) { + response = target.getHeadHandler().handle(new ClientRequestImpl(target.getURI(), request.method().name(), request.entity().getEntity(), headers)); + } else { + response = target.getHeadHandler().handle(new ClientRequestImpl(target.getURI(), request.method().name(), null, headers)); + } + return new JerseyResponse(response); + } catch (UniformInterfaceException e) { + throw new OpenStackResponseException(e.getResponse().getClientResponseStatus().getReasonPhrase(), e.getResponse().getStatus()); + } + } + + @Provider + public static class OpenStackObjectMapper implements ContextResolver { + static ObjectMapper DEFAULT_MAPPER; + static ObjectMapper WRAPPED_MAPPER; + static { + DEFAULT_MAPPER = new ObjectMapper(); + DEFAULT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); + DEFAULT_MAPPER.enable(SerializationFeature.INDENT_OUTPUT); + DEFAULT_MAPPER.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + DEFAULT_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + DEFAULT_MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); + + WRAPPED_MAPPER = new ObjectMapper(); + WRAPPED_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); + WRAPPED_MAPPER.enable(SerializationFeature.INDENT_OUTPUT); + WRAPPED_MAPPER.enable(SerializationFeature.WRAP_ROOT_VALUE); + WRAPPED_MAPPER.enable(DeserializationFeature.UNWRAP_ROOT_VALUE); + WRAPPED_MAPPER.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + WRAPPED_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + WRAPPED_MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); + } + + @Override + public ObjectMapper getContext(Class type) { + return type.getAnnotation(JsonRootName.class) == null ? DEFAULT_MAPPER : WRAPPED_MAPPER; + } + } +} diff --git a/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyResponse.java b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyResponse.java new file mode 100755 index 000000000..1260bb686 --- /dev/null +++ b/openstack-client-connectors/jersey-connector/src/main/java/com/woorea/openstack/connector/JerseyResponse.java @@ -0,0 +1,54 @@ +package com.woorea.openstack.connector; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +import com.sun.jersey.api.client.ClientResponse; +import com.woorea.openstack.base.client.OpenStackResponse; +import com.woorea.openstack.base.client.OpenStackResponseException; + +public class JerseyResponse implements OpenStackResponse { + + private ClientResponse response; + + public JerseyResponse(ClientResponse response) { + this.response = response; + } + + @Override + public T getEntity(Class returnType) { + if(response.getStatus() >= 400) { + throw new OpenStackResponseException(response.getClientResponseStatus().getReasonPhrase(), + response.getStatus()); + } + if(response.hasEntity() && returnType != null && Void.class != returnType) { + return response.getEntity(returnType); + } else { + return null; + } + } + + @Override + public InputStream getInputStream() { + if(response.hasEntity()) { + return response.getEntityInputStream(); + } else { + return null; + } + } + + @Override + public String header(String name) { + return response.getHeaders().getFirst(name); + } + + @Override + public Map headers() { + Map headers = new HashMap(); + for(String k : response.getHeaders().keySet()) { + headers.put(k, response.getHeaders().getFirst(k)); + } + return headers; + } +} diff --git a/openstack-client-connectors/jersey-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector b/openstack-client-connectors/jersey-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector new file mode 100644 index 000000000..5b9a15809 --- /dev/null +++ b/openstack-client-connectors/jersey-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector @@ -0,0 +1 @@ +com.woorea.openstack.connector.JerseyConnector \ No newline at end of file diff --git a/openstack-client-connectors/jersey2-connector/pom.xml b/openstack-client-connectors/jersey2-connector/pom.xml new file mode 100644 index 000000000..e2c45a753 --- /dev/null +++ b/openstack-client-connectors/jersey2-connector/pom.xml @@ -0,0 +1,33 @@ + + + 4.0.0 + + com.woorea + openstack-client-connectors + 3.2.10-SNAPSHOT + + jersey2-connector + OpenStack Jersey2 Connector + OpenStack Jersey2 Connector + http://maven.apache.org + + UTF-8 + + + + org.glassfish.jersey.core + jersey-client + 2.6 + + + org.glassfish.jersey.media + jersey-media-json-jackson + 2.6 + + + com.woorea + openstack-client + 3.2.10-SNAPSHOT + + + diff --git a/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Connector.java b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Connector.java new file mode 100644 index 000000000..82b9d5b95 --- /dev/null +++ b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Connector.java @@ -0,0 +1,66 @@ +package com.woorea.openstack.connector; + +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import javax.ws.rs.ClientErrorException; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.MediaType; + +import org.glassfish.jersey.filter.LoggingFilter; + +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClientConnector; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.base.client.OpenStackResponse; +import com.woorea.openstack.base.client.OpenStackResponseException; + +public class JaxRs20Connector implements OpenStackClientConnector { + + protected Client client = OpenStack.CLIENT; + + @Override + public OpenStackResponse request(OpenStackRequest request) { + WebTarget target = client.target(request.endpoint()).path(request.path()); + + for(Map.Entry > entry : request.queryParams().entrySet()) { + for (Object o : entry.getValue()) { + target = target.queryParam(entry.getKey(), o); + } + } + + target.register(new LoggingFilter(Logger.getLogger("os"), 10000)); + Invocation.Builder invocation = target.request(); + + for(Map.Entry> h : request.headers().entrySet()) { + StringBuilder sb = new StringBuilder(); + for(Object v : h.getValue()) { + sb.append(String.valueOf(v)); + } + invocation.header(h.getKey(), sb); + } + + Entity entity = (request.entity() == null) ? null : + Entity.entity(request.entity().getEntity(), request.entity().getContentType()); + + try { + if (entity != null) { + return new JaxRs20Response(invocation.method(request.method().name(), entity)); + } else { + if(HttpMethod.PUT == request.method()) { + return new JaxRs20Response(invocation.method(request.method().name(), Entity.entity("", MediaType.APPLICATION_JSON))); + } else { + return new JaxRs20Response(invocation.method(request.method().name())); + } + } + } catch (ClientErrorException e) { + throw new OpenStackResponseException(e.getResponse() + .getStatusInfo().toString(), e.getResponse().getStatus()); + } + } + +} diff --git a/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Response.java b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Response.java new file mode 100644 index 000000000..ebddd0771 --- /dev/null +++ b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/JaxRs20Response.java @@ -0,0 +1,48 @@ +package com.woorea.openstack.connector; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +import javax.ws.rs.core.Response; + +import com.woorea.openstack.base.client.OpenStackResponse; +import com.woorea.openstack.base.client.OpenStackResponseException; + +public class JaxRs20Response implements OpenStackResponse { + + private Response response; + + public JaxRs20Response(Response response) { + this.response = response; + } + + @Override + public T getEntity(Class returnType) { + if(response.getStatus() >= 400) { + throw new OpenStackResponseException(response.getStatusInfo().getReasonPhrase(), + response.getStatusInfo().getStatusCode()); + } + return response.readEntity(returnType); + } + + @Override + public InputStream getInputStream() { + return (InputStream) response.getEntity(); + } + + @Override + public String header(String name) { + return response.getHeaderString(name); + } + + @Override + public Map headers() { + Map headers = new HashMap(); + for(String k : response.getHeaders().keySet()) { + headers.put(k, response.getHeaderString(k)); + } + return headers; + } + +} diff --git a/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/OpenStack.java b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/OpenStack.java new file mode 100644 index 000000000..bb321bfc4 --- /dev/null +++ b/openstack-client-connectors/jersey2-connector/src/main/java/com/woorea/openstack/connector/OpenStack.java @@ -0,0 +1,111 @@ +package com.woorea.openstack.connector; + +import java.io.IOException; + +import javax.net.ssl.SSLContext; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.ClientRequestContext; +import javax.ws.rs.client.ClientRequestFilter; +import javax.ws.rs.ext.ContextResolver; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.annotation.JsonRootName; +import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion; +import org.glassfish.jersey.SslConfigurator; +import org.glassfish.jersey.jackson.JacksonFeature; + +public class OpenStack { + + public static Client CLIENT; + + public static ObjectMapper DEFAULT_MAPPER; + + public static ObjectMapper WRAPPED_MAPPER; + + static { + initialize(); + } + + private static void initialize() { + + /* + //class MyX509TrustManager implements X509TrustManager + TrustManager mytm[] = null; + KeyManager mykm[] = null; + + try { + mytm = new TrustManager[]{new MyX509TrustManager("./truststore_client", "asdfgh".toCharArray())}; + mykm = new KeyManager[]{new MyX509KeyManager("./keystore_client", "asdfgh".toCharArray())}; + } catch (Exception ex) { + + } + + SSLContext context = null; + context = SSLContext.getInstance("SSL"); + context.init(mykm, mytm, null); + + */ + + try { + + SSLContext context = null; + context = SSLContext.getInstance("SSL"); + context.init(null, null, null); + + SslConfigurator sslConfig = SslConfigurator.newInstance(); + /* + .trustStoreFile("./truststore_client") + .trustStorePassword("asdfgh") + + .keyStoreFile("./keystore_client") + .keyPassword("asdfgh"); + */ + //old: CLIENT.property(ClientProperties.SSL_CONFIG, new SslConfig(context)); + + CLIENT = ClientBuilder.newBuilder().sslContext(sslConfig.createSSLContext()).build(); + + DEFAULT_MAPPER = new ObjectMapper(); + + DEFAULT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); + DEFAULT_MAPPER.enable(SerializationFeature.INDENT_OUTPUT); + DEFAULT_MAPPER.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + DEFAULT_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + DEFAULT_MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); + + WRAPPED_MAPPER = new ObjectMapper(); + + WRAPPED_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); + WRAPPED_MAPPER.enable(SerializationFeature.INDENT_OUTPUT); + WRAPPED_MAPPER.enable(SerializationFeature.WRAP_ROOT_VALUE); + WRAPPED_MAPPER.enable(DeserializationFeature.UNWRAP_ROOT_VALUE); + WRAPPED_MAPPER.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + WRAPPED_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + WRAPPED_MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); + + CLIENT.register(new JacksonFeature()).register(new ContextResolver() { + + public ObjectMapper getContext(Class type) { + return type.getAnnotation(JsonRootName.class) == null ? DEFAULT_MAPPER : WRAPPED_MAPPER; + } + + }); + + CLIENT.register(new ClientRequestFilter() { + + public void filter(ClientRequestContext requestContext) throws IOException { + requestContext.getHeaders().remove("Content-Language"); + requestContext.getHeaders().remove("Content-Encoding"); + } + }); + + } catch(Exception e) { + throw new RuntimeException(e.getMessage(), e); + } + + } + +} diff --git a/openstack-client-connectors/jersey2-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector b/openstack-client-connectors/jersey2-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector new file mode 100644 index 000000000..fc2445772 --- /dev/null +++ b/openstack-client-connectors/jersey2-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector @@ -0,0 +1 @@ +com.woorea.openstack.connector.JaxRs20Connector \ No newline at end of file diff --git a/openstack-client-connectors/pom.xml b/openstack-client-connectors/pom.xml new file mode 100644 index 000000000..eeb26fb02 --- /dev/null +++ b/openstack-client-connectors/pom.xml @@ -0,0 +1,48 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + openstack-client-connectors + OpenStack Client Connectors + OpenStack Client Connectors + pom + + + jersey + + true + + + jersey-connector + + + + jersey2 + + true + + + jersey2-connector + + + + resteasy + + true + + + resteasy-connector + + + + + + com.woorea + openstack-client + 3.2.10-SNAPSHOT + + + \ No newline at end of file diff --git a/openstack-client-connectors/resteasy-connector/pom.xml b/openstack-client-connectors/resteasy-connector/pom.xml new file mode 100644 index 000000000..be0b2acb5 --- /dev/null +++ b/openstack-client-connectors/resteasy-connector/pom.xml @@ -0,0 +1,28 @@ + + 4.0.0 + + com.woorea + openstack-client-connectors + 3.2.10-SNAPSHOT + + resteasy-connector + OpenStack RESTEasy Connector + OpenStack RESTEasy Connector + + + org.jboss.resteasy + resteasy-jaxrs + 3.0.26.Final + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + 2.9.8 + + + org.apache.httpcomponents + httpclient + 4.5.5 + + + diff --git a/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyConnector.java b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyConnector.java new file mode 100644 index 000000000..5e078a344 --- /dev/null +++ b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyConnector.java @@ -0,0 +1,123 @@ +package com.woorea.openstack.connector; + +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import com.fasterxml.jackson.annotation.JsonInclude; +import org.apache.http.HttpStatus; +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.annotation.JsonRootName; +import org.jboss.resteasy.client.ClientExecutor; +import org.jboss.resteasy.client.ClientRequest; +import org.jboss.resteasy.client.ClientResponse; +import org.jboss.resteasy.plugins.providers.InputStreamProvider; +import org.jboss.resteasy.spi.ResteasyProviderFactory; + +import com.woorea.openstack.base.client.OpenStackClientConnector; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.base.client.OpenStackResponse; +import com.woorea.openstack.base.client.OpenStackResponseException; + +public class RESTEasyConnector implements OpenStackClientConnector { + + public static ObjectMapper DEFAULT_MAPPER; + + public static ObjectMapper WRAPPED_MAPPER; + + @Provider + @Produces(MediaType.APPLICATION_JSON) + static class ObjectMapperContextResolver implements ContextResolver { + public ObjectMapper getContext(Class type) { + return type.getAnnotation(JsonRootName.class) == null ? DEFAULT_MAPPER : WRAPPED_MAPPER; + } + } + + private static ResteasyProviderFactory providerFactory; + + static { + DEFAULT_MAPPER = new ObjectMapper(); + + DEFAULT_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); + DEFAULT_MAPPER.enable(SerializationFeature.INDENT_OUTPUT); + DEFAULT_MAPPER.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + DEFAULT_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + DEFAULT_MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); + + WRAPPED_MAPPER = new ObjectMapper(); + + WRAPPED_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); + WRAPPED_MAPPER.enable(SerializationFeature.INDENT_OUTPUT); + WRAPPED_MAPPER.enable(SerializationFeature.WRAP_ROOT_VALUE); + WRAPPED_MAPPER.enable(DeserializationFeature.UNWRAP_ROOT_VALUE); + WRAPPED_MAPPER.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + WRAPPED_MAPPER.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); + WRAPPED_MAPPER.enable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT); + + providerFactory = new ResteasyProviderFactory(); + providerFactory.registerProviderInstance(new JacksonJsonProvider()); + providerFactory.registerProviderInstance(new ObjectMapperContextResolver()); + providerFactory.registerProviderInstance(new InputStreamProvider()); + } + + protected ClientExecutor createClientExecutor() { + return ClientRequest.getDefaultExecutor(); + } + + public OpenStackResponse request(OpenStackRequest request) { + String requestPath = request.path(); + if (requestPath != null && requestPath.isEmpty()) { + requestPath = "/"; + } + ClientRequest client = new ClientRequest(UriBuilder.fromUri(request.endpoint() + requestPath), + createClientExecutor(), providerFactory); + + for(Map.Entry > entry : request.queryParams().entrySet()) { + for (Object o : entry.getValue()) { + client = client.queryParameter(entry.getKey(), String.valueOf(o)); + } + } + + for (Entry> h : request.headers().entrySet()) { + StringBuilder sb = new StringBuilder(); + for (Object v : h.getValue()) { + sb.append(String.valueOf(v)); + } + client.header(h.getKey(), sb); + } + + if (request.entity() != null) { + client.body(request.entity().getContentType(), request.entity().getEntity()); + } + + ClientResponse response; + + try { + response = client.httpMethod(request.method().name(), request.returnType()); + } catch (Exception e) { + throw new RuntimeException("Unexpected client exception", e); + } + + if (response.getStatus() == HttpStatus.SC_OK + || response.getStatus() == HttpStatus.SC_CREATED + || response.getStatus() == HttpStatus.SC_NO_CONTENT + || response.getStatus() == HttpStatus.SC_ACCEPTED) { + return new RESTEasyResponse(client, response); + } + + response.releaseConnection(); + + throw new OpenStackResponseException(response.getResponseStatus() + .getReasonPhrase(), response.getStatus()); + } + +} diff --git a/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyInputStream.java b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyInputStream.java new file mode 100644 index 000000000..913a5000d --- /dev/null +++ b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyInputStream.java @@ -0,0 +1,37 @@ +package com.woorea.openstack.connector; + +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.SocketException; + +import org.jboss.resteasy.client.ClientExecutor; + + +public class RESTEasyInputStream extends FilterInputStream { + + protected ClientExecutor clientExecutor; + + public RESTEasyInputStream(InputStream inputStream, ClientExecutor clientExecutor) { + super(inputStream); + this.clientExecutor = clientExecutor; + } + + @Override + public void close() throws IOException { + try { + clientExecutor.close(); + } catch (Exception e) { + // Silently skip errors in the socket close errors + } + + try { + super.close(); + } catch (SocketException e) { + // We expect this exception because the socket is closed + } catch (IllegalStateException e) { + // We expect this exception because the socket is closed (httpclient 4.2) + } + } + +} diff --git a/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyResponse.java b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyResponse.java new file mode 100644 index 000000000..269ae13c9 --- /dev/null +++ b/openstack-client-connectors/resteasy-connector/src/main/java/com/woorea/openstack/connector/RESTEasyResponse.java @@ -0,0 +1,50 @@ +package com.woorea.openstack.connector; + +import org.jboss.resteasy.client.ClientRequest; +import org.jboss.resteasy.client.ClientResponse; +import com.woorea.openstack.base.client.OpenStackResponse; + +import javax.ws.rs.core.MultivaluedMap; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +public class RESTEasyResponse implements OpenStackResponse { + + private ClientRequest client; + + private ClientResponse response; + + public RESTEasyResponse(ClientRequest client, ClientResponse response) { + this.client = client; + this.response = response; + } + + @Override + public T getEntity(Class returnType) { + return (T) response.getEntity(returnType); + } + + @Override + public InputStream getInputStream() { + return new RESTEasyInputStream((InputStream) response.getEntity(InputStream.class), client.getExecutor()); + } + + @Override + public String header(String name) { + return response.getHeaders().getFirst(name).toString(); + } + + @Override + public Map headers() { + Map headers = new HashMap(); + MultivaluedMap responseHeaders = response.getHeaders(); + + for (String key : responseHeaders.keySet()) { + headers.put(key, responseHeaders.getFirst(key).toString()); + } + + return headers; + } + +} diff --git a/openstack-client-connectors/resteasy-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector b/openstack-client-connectors/resteasy-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector new file mode 100644 index 000000000..dbb991da5 --- /dev/null +++ b/openstack-client-connectors/resteasy-connector/src/main/resources/META-INF/services/com.woorea.openstack.base.client.OpenStackClientConnector @@ -0,0 +1 @@ +com.woorea.openstack.connector.RESTEasyConnector \ No newline at end of file diff --git a/openstack-client/pom.xml b/openstack-client/pom.xml new file mode 100644 index 000000000..58e160b63 --- /dev/null +++ b/openstack-client/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + openstack-client + OpenStack Client + OpenStack Client + \ No newline at end of file diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/Entity.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/Entity.java new file mode 100644 index 000000000..42eb5fd1e --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/Entity.java @@ -0,0 +1,54 @@ +package com.woorea.openstack.base.client; + +import java.io.InputStream; + + +public class Entity { + + private T entity; + + private String contentType; + + public static Entity json(T entity) { + return new Entity(entity, "application/json"); + } + + public static Entity stream(T entity) { + return new Entity(entity, "application/octet-stream"); + } + + public Entity(T entity, String contentType) { + super(); + this.entity = entity; + this.contentType = contentType; + } + + /** + * @return the entity + */ + public T getEntity() { + return entity; + } + + /** + * @param entity the entity to set + */ + public void setEntity(T entity) { + this.entity = entity; + } + + /** + * @return the contentType + */ + public String getContentType() { + return contentType; + } + + /** + * @param contentType the contentType to set + */ + public void setContentType(String contentType) { + this.contentType = contentType; + } + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/HttpMethod.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/HttpMethod.java new file mode 100644 index 000000000..6c62ffb7b --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/HttpMethod.java @@ -0,0 +1,5 @@ +package com.woorea.openstack.base.client; + +public enum HttpMethod { + HEAD, GET, POST, PUT, PATCH, DELETE, OPTIONS, TRACE +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java new file mode 100644 index 000000000..3c8b6cac3 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClient.java @@ -0,0 +1,86 @@ +package com.woorea.openstack.base.client; + +import java.util.Properties; +import java.util.ServiceLoader; + +public class OpenStackClient { + + protected String endpoint; + + protected OpenStackTokenProvider tokenProvider; + + protected static int AUTHENTICATION_RETRIES = 1; + + protected OpenStackClientConnector connector; + + protected Properties properties = new Properties(); + + protected static OpenStackClientConnector DEFAULT_CONNECTOR; + + static { + ServiceLoader connectorLoader; + connectorLoader = ServiceLoader.load(OpenStackClientConnector.class); + + for (OpenStackClientConnector clientConnector : connectorLoader) { + DEFAULT_CONNECTOR = clientConnector; + break; + } + } + + public OpenStackClient(String endpoint) { + this.endpoint = endpoint; + this.connector = DEFAULT_CONNECTOR; + } + + public OpenStackClient(String endpoint, OpenStackClientConnector connector) { + this.endpoint = endpoint; + this.connector = (connector == null) ? DEFAULT_CONNECTOR : connector; + } + + public OpenStackResponse request(OpenStackRequest request) { + OpenStackResponseException authException = null; + + for (int i = 0; i <= AUTHENTICATION_RETRIES; i++) { + request.endpoint(endpoint); + + if (tokenProvider != null) { + request.header("X-Auth-Token", tokenProvider.getToken()); + } + + try { + return connector.request(request); + } catch (OpenStackResponseException e) { + if (e.getStatus() != OpenStackResponseStatus.NOT_AUTHORIZED + || tokenProvider == null) { + throw e; + } + authException = e; + tokenProvider.expireToken(); + } + } + + throw authException; + } + + public T execute(OpenStackRequest request) { + OpenStackResponse response = request(request); + return (request.returnType() != null && request.returnType() != Void.class) ? response.getEntity(request.returnType()) : null; + } + + public void property(String property, String value) { + properties.put(property, value); + } + + public void setTokenProvider(OpenStackTokenProvider tokenProvider) { + this.tokenProvider = tokenProvider; + } + + public void token(String token) { + setTokenProvider(new OpenStackSimpleTokenProvider(token)); + } + + public OpenStackRequest get(String path, Class returnType) { + return new OpenStackRequest(this, HttpMethod.GET, path, null, returnType); + } + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClientConnector.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClientConnector.java new file mode 100644 index 000000000..417b84440 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackClientConnector.java @@ -0,0 +1,8 @@ +package com.woorea.openstack.base.client; + + +public interface OpenStackClientConnector { + + public OpenStackResponse request(OpenStackRequest request); + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java new file mode 100644 index 000000000..5ef291f5e --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackCommand.java @@ -0,0 +1,8 @@ +package com.woorea.openstack.base.client; +//package org.openstack.base.client; +// +//public interface OpenStackCommand { +// +// OpenStackRequest createRequest(OpenStackClient connector); +// +//} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java new file mode 100644 index 000000000..5da28bef8 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackRequest.java @@ -0,0 +1,148 @@ +package com.woorea.openstack.base.client; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; + +public class OpenStackRequest { + + private OpenStackClient client; + + public OpenStackRequest() { + + } + + public OpenStackRequest(OpenStackClient client, HttpMethod method, String path, Entity entity, Class returnType) { + this(client, method, (CharSequence)path, entity, returnType); + } + + public OpenStackRequest(OpenStackClient client, HttpMethod method, CharSequence path, Entity entity, Class returnType) { + this.client = client; + this.method = method; + this.path = new StringBuilder(path); + this.entity = entity; + this.returnType = returnType; + header("Accept", "application/json"); + } + + private String endpoint; + + private HttpMethod method; + + private StringBuilder path = new StringBuilder(); + + private Map> headers = new HashMap>(); + + private Entity entity; + + private Class returnType; + + public OpenStackRequest endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + public String endpoint() { + return endpoint; + } + + public OpenStackRequest method(HttpMethod method) { + this.method = method; + return this; + } + + public HttpMethod method() { + return method; + } + + public OpenStackRequest path(String path) { + this.path.append(path); + return this; + } + + public String path() { + return path.toString(); + } + + public OpenStackRequest header(String name, Object value) { + if(value != null) { + headers.put(name, Arrays.asList(value)); + } + return this; + } + + public Map> headers() { + return headers; + } + + public Entity entity(T entity, String contentType) { + return new Entity(entity, contentType); + } + + public Entity entity() { + return entity; + } + + public Entity json(T entity) { + return entity(entity, "application/json"); + } + + public void returnType(Class returnType) { + this.returnType = returnType; + } + + public Class returnType() { + return returnType; + } + + public R execute() { + return client.execute(this); + } + + public OpenStackResponse request() { + return client.request(this); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "OpenStackRequest [endpoint=" + endpoint + ", method=" + method + + ", path=" + path + ", headers=" + headers + ", entity=" + + entity + ", returnType=" + returnType + "]"; + } + + private Map > queryParams = new LinkedHashMap >(); + + public Map > queryParams() { + return queryParams; + } + + public OpenStackRequest queryParam(String key, Object value) { + if (queryParams.containsKey(key)) { + List values = queryParams.get(key); + values.add(value); + } else { + List values = new ArrayList(); + values.add(value); + queryParams.put(key, values); + } + + return this; + } + + protected static String buildPath(String ... elements) { + StringBuilder stringBuilder = new StringBuilder(); + final String PATH_SEPARATOR = "/"; + for (String element : elements) { + stringBuilder.append(PATH_SEPARATOR); + stringBuilder.append(element); + } + + return stringBuilder.toString(); + } +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponse.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponse.java new file mode 100644 index 000000000..024e21005 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponse.java @@ -0,0 +1,16 @@ +package com.woorea.openstack.base.client; + +import java.io.InputStream; +import java.util.Map; + +public interface OpenStackResponse { + + public T getEntity(Class returnType); + + public InputStream getInputStream(); + + public String header(String name); + + public Map headers(); + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java new file mode 100644 index 000000000..5c15b171f --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseException.java @@ -0,0 +1,24 @@ +package com.woorea.openstack.base.client; + +public class OpenStackResponseException extends RuntimeException { + + private static final long serialVersionUID = 7294957362769575271L; + + protected String message; + + protected int status; + + public OpenStackResponseException(String message, int status) { + this.message = message; + this.status = status; + } + + public String getMessage() { + return message; + } + + public int getStatus() { + return status; + } + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseStatus.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseStatus.java new file mode 100644 index 000000000..032a51154 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackResponseStatus.java @@ -0,0 +1,11 @@ +package com.woorea.openstack.base.client; + +public class OpenStackResponseStatus { + + public static final int OK = 200; + + public static final int NOT_AUTHORIZED = 401; + + public static final int CONFLICT = 409; + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackSimpleTokenProvider.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackSimpleTokenProvider.java new file mode 100644 index 000000000..5ea8d7667 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackSimpleTokenProvider.java @@ -0,0 +1,20 @@ +package com.woorea.openstack.base.client; + +public class OpenStackSimpleTokenProvider implements OpenStackTokenProvider { + + String token; + + public OpenStackSimpleTokenProvider(String token) { + this.token = token; + } + + @Override + public String getToken() { + return this.token; + } + + @Override + public void expireToken() { + } + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackTokenProvider.java b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackTokenProvider.java new file mode 100644 index 000000000..0a8f1bfbd --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/base/client/OpenStackTokenProvider.java @@ -0,0 +1,9 @@ +package com.woorea.openstack.base.client; + +public interface OpenStackTokenProvider { + + String getToken(); + + void expireToken(); + +} diff --git a/openstack-client/src/main/java/com/woorea/openstack/common/client/AbstractOpenStackClient.java b/openstack-client/src/main/java/com/woorea/openstack/common/client/AbstractOpenStackClient.java new file mode 100644 index 000000000..e48ec0b2b --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/common/client/AbstractOpenStackClient.java @@ -0,0 +1,125 @@ +package com.woorea.openstack.common.client; +//package org.openstack.common.client; +// +//import java.io.IOException; +//import java.util.logging.Logger; +// +//import javax.ws.rs.client.ClientRequestContext; +//import javax.ws.rs.client.ClientRequestFilter; +//import javax.ws.rs.client.Entity; +//import javax.ws.rs.client.Invocation.Builder; +//import javax.ws.rs.client.WebTarget; +//import javax.ws.rs.core.MediaType; +// +//import org.glassfish.jersey.filter.LoggingFilter; +//import org.openstack.connector.OpenStack; +// +//public class AbstractOpenStackClient { +// +// protected String endpointURL; +// +// protected String token; +// +// protected LoggingFilter loggingFilter; +// +// protected ClientRequestFilter tokenFilter = new ClientRequestFilter() { +// +// @Override +// public void filter(ClientRequestContext requestContext) throws IOException { +// requestContext.getHeaders().putSingle("X-Auth-Token", token); +// } +// }; +// +// public AbstractOpenStackClient(String endpointURL, String token) { +// this.endpointURL = endpointURL; +// this.token = token; +// } +// +// public AbstractOpenStackClient(String endpointURL) { +// this(endpointURL, null); +// } +// +// /** +// * @param token the token to set +// */ +// public void setToken(String token) { +// this.token = token; +// } +// +// public OpenStackRequest request(String uri, String... mediaTypes) { +// WebTarget endpoint = OpenStack.CLIENT.target(endpointURL); +// if(token != null) { +// endpoint.register(tokenFilter); +// } +// return new OpenStackRequest(endpoint.path(uri).request(mediaTypes)); +// } +// +// public OpenStackRequest request(String uri) { +// return request(uri, MediaType.APPLICATION_JSON); +// } +// +// protected WebTarget create(String endpoint) { +// WebTarget target = OpenStack.CLIENT.target(endpoint); +// if(loggingFilter != null) { +// target.register(loggingFilter); +// } +// if(token != null) { +// target.register(tokenFilter); +// } +// return target; +// } +// +// public void enableLogging(Logger logger, int entitySize) { +// loggingFilter = new LoggingFilter(logger, entitySize); +// } +// +// public void disableLogging() { +// loggingFilter = null; +// } +// +// public static class OpenStackRequest { +// +// private Builder builder; +// +// private OpenStackRequest(Builder builder) { +// this.builder = builder; +// } +// +// public ResponseType execute(String method, Class type) { +// return builder.method(method, type); +// } +// +// public ResponseType execute(String method, Entity data, Class type) { +// return builder.method(method, data, type); +// } +// +// public void execute(String method) { +// builder.method(method); +// } +// +// public void execute(String method, Entity data) { +// builder.method(method, data, Void.class); +// } +// +// public ResponseType get(Class type) { +// return execute("GET", type); +// } +// +// public ResponseType postJson(Object data, Class type) { +// return execute("POST", Entity.json(data), type); +// } +// +// public ResponseType putJson(Object data, Class type) { +// return execute("PUT", Entity.json(data), type); +// } +// +// public ResponseType patchJson(Object data, Class type) { +// return execute("PATCH", Entity.json(data), type); +// } +// +// public void delete() { +// execute("DELETE", Void.class); +// } +// } +// +//} diff --git a/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSession.java b/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSession.java new file mode 100644 index 000000000..a56a3afcb --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSession.java @@ -0,0 +1,107 @@ +package com.woorea.openstack.common.session; +//package org.openstack.common.session; +// +//import java.io.Serializable; +// +//import org.openstack.keystone.model.Access; +//import org.openstack.keystone.model.Authentication; +// +//public class OpenStackSession implements Serializable { +// +// private String authenticationURL; +// +// private Authentication authentication; +// +// private String identityAdministrationURL; +// +// private String identityAdministrationToken; +// +// private Access access; +// +// private boolean admin; +// +// /** +// * @return the authenticationURL +// */ +// public String getAuthenticationURL() { +// return authenticationURL; +// } +// +// /** +// * @param authenticationURL the authenticationURL to set +// */ +// public void setAuthenticationURL(String authenticationURL) { +// this.authenticationURL = authenticationURL; +// } +// +// /** +// * @return the authentication +// */ +// public Authentication getAuthentication() { +// return authentication; +// } +// +// /** +// * @param authentication the authentication to set +// */ +// public void setAuthentication(Authentication authentication) { +// this.authentication = authentication; +// } +// +// /** +// * @return the identityAdministrationURL +// */ +// public String getIdentityAdministrationURL() { +// return identityAdministrationURL; +// } +// +// /** +// * @param identityAdministrationURL the identityAdministrationURL to set +// */ +// public void setIdentityAdministrationURL(String identityAdministrationURL) { +// this.identityAdministrationURL = identityAdministrationURL; +// } +// +// /** +// * @return the identityAdministrationToken +// */ +// public String getIdentityAdministrationToken() { +// return identityAdministrationToken; +// } +// +// /** +// * @param identityAdministrationToken the identityAdministrationToken to set +// */ +// public void setIdentityAdministrationToken(String identityAdministrationToken) { +// this.identityAdministrationToken = identityAdministrationToken; +// } +// +// /** +// * @return the access +// */ +// public Access getAccess() { +// return access; +// } +// +// /** +// * @param access the access to set +// */ +// public void setAccess(Access access) { +// this.access = access; +// } +// +// /** +// * @return the admin +// */ +// public boolean isAdmin() { +// return admin; +// } +// +// /** +// * @param admin the admin to set +// */ +// public void setAdmin(boolean admin) { +// this.admin = admin; +// } +// +//} diff --git a/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSessionHolder.java b/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSessionHolder.java new file mode 100644 index 000000000..ea81f7c41 --- /dev/null +++ b/openstack-client/src/main/java/com/woorea/openstack/common/session/OpenStackSessionHolder.java @@ -0,0 +1,16 @@ +package com.woorea.openstack.common.session; +//package org.openstack.common.session; +// +//public class OpenStackSessionHolder { +// +// private static final ThreadLocal HOLDER = new ThreadLocal(); +// +// public static OpenStackSession getSession() { +// return HOLDER.get(); +// } +// +// public static void setSession(OpenStackSession session) { +// HOLDER.set(session); +// } +// +//} diff --git a/openstack-console/pom.xml b/openstack-console/pom.xml new file mode 100644 index 000000000..46d735c3e --- /dev/null +++ b/openstack-console/pom.xml @@ -0,0 +1,77 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + openstack-console + OpenStack Console + OpenStack Console + + + commons-cli + commons-cli + 1.2 + + + jline + jline + 2.10 + + + com.woorea + keystone-client + 3.2.10-SNAPSHOT + + + com.woorea + nova-client + 3.2.10-SNAPSHOT + + + + + jersey + + + com.woorea + jersey-connector + 3.0.0-SNAPSHOT + + + + + jersey2 + + + com.woorea + jersey2-connector + 3.0.0-SNAPSHOT + + + + + resteasy + + + com.woorea + resteasy-connector + 3.0.0-SNAPSHOT + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + com.woorea.openstack.console.Main + + + + + \ No newline at end of file diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/Command.java b/openstack-console/src/main/java/com/woorea/openstack/console/Command.java new file mode 100644 index 000000000..4c96e2509 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/Command.java @@ -0,0 +1,21 @@ +package com.woorea.openstack.console; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Options; + + +public abstract class Command { + + protected String name; + + public Command(String name) { + this.name = name; + } + + public abstract void execute(Console console, CommandLine args); + + public Options getOptions() { + return new Options(); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/CommandLineHelper.java b/openstack-console/src/main/java/com/woorea/openstack/console/CommandLineHelper.java new file mode 100644 index 000000000..6e148ce5d --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/CommandLineHelper.java @@ -0,0 +1,71 @@ +package com.woorea.openstack.console; + +import java.util.StringTokenizer; +import java.util.Vector; + +public class CommandLineHelper { + + public static String[] parse(String input) { + if (input == null || input.length() == 0) { + //no command? no string + return new String[0]; + } + // parse with a simple finite state machine + + final int normal = 0; + final int inQuote = 1; + final int inDoubleQuote = 2; + int state = normal; + StringTokenizer tok = new StringTokenizer(input, "\"\' ", true); + Vector v = new Vector(); + StringBuffer current = new StringBuffer(); + boolean lastTokenHasBeenQuoted = false; + + while (tok.hasMoreTokens()) { + String nextTok = tok.nextToken(); + switch (state) { + case inQuote: + if ("\'".equals(nextTok)) { + lastTokenHasBeenQuoted = true; + state = normal; + } else { + current.append(nextTok); + } + break; + case inDoubleQuote: + if ("\"".equals(nextTok)) { + lastTokenHasBeenQuoted = true; + state = normal; + } else { + current.append(nextTok); + } + break; + default: + if ("\'".equals(nextTok)) { + state = inQuote; + } else if ("\"".equals(nextTok)) { + state = inDoubleQuote; + } else if (" ".equals(nextTok)) { + if (lastTokenHasBeenQuoted || current.length() != 0) { + v.addElement(current.toString()); + current = new StringBuffer(); + } + } else { + current.append(nextTok); + } + lastTokenHasBeenQuoted = false; + break; + } + } + if (lastTokenHasBeenQuoted || current.length() != 0) { + v.addElement(current.toString()); + } + if (state == inQuote || state == inDoubleQuote) { + throw new RuntimeException("unbalanced quotes in " + input); + } + String[] args = new String[v.size()]; + v.copyInto(args); + return args; + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/Commands.java b/openstack-console/src/main/java/com/woorea/openstack/console/Commands.java new file mode 100644 index 000000000..e8b39dc5c --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/Commands.java @@ -0,0 +1,31 @@ +package com.woorea.openstack.console; + +import java.util.Map; + +import org.apache.commons.cli.CommandLine; + +public class Commands { + + public static final Command EXIT = new Command("exit") { + + @Override + public void execute(Console console, CommandLine args) { + console.exit(); + } + + }; + + public static final Command SET = new Command("set") { + + @Override + public void execute(Console console, CommandLine args) { + if(args.getArgs().length == 2) { + console.setProperty(args.getArgs()[0], args.getArgs()[1]); + } else { + console.properties(); + } + } + + }; + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/Console.java b/openstack-console/src/main/java/com/woorea/openstack/console/Console.java new file mode 100644 index 000000000..0f7ad8446 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/Console.java @@ -0,0 +1,112 @@ +package com.woorea.openstack.console; + +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Properties; +import java.util.Set; + +import jline.UnsupportedTerminal; +import jline.console.ConsoleReader; +import jline.console.completer.Completer; +import jline.console.completer.StringsCompleter; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.CommandLineParser; +import org.apache.commons.cli.GnuParser; +import org.apache.commons.cli.HelpFormatter; + +public class Console { + + private Properties properties; + + private ConsoleReader reader; + + private Environment environment; + + private HelpFormatter helpFormatter = new HelpFormatter(); + + private static final CommandLineParser PARSER = new GnuParser(); + + public Console(Environment environment, Properties properties) { + this.properties = properties; + this.environment = environment; + } + + public void start() throws IOException { + if(System.console() == null) { + reader = new ConsoleReader(System.in, System.out, new UnsupportedTerminal()); + } else { + reader = new ConsoleReader(); + } + do { + String line = reader.readLine(environment.getPrompt()); + execute(line); + } while(true); + } + + public void execute(String line) { + String[] tokens = CommandLineHelper.parse(line); + if(tokens.length > 0) { + Command command = environment.commands.get(tokens[0]); + if(command != null) { + try { + CommandLine args = Console.PARSER.parse(command.getOptions(), Arrays.copyOfRange(tokens, 1, tokens.length)); + command.execute(this, args); + } catch (Exception e) { + e.printStackTrace(); + helpFormatter.printHelp(command.name, command.getOptions()); + } + } + } + } + + public void setEnvironment(Environment environment) { + Set completers = new HashSet(reader.getCompleters()); + for(Completer c : completers) { + reader.removeCompleter(c); + } + Set commands = new HashSet(); + for(Map.Entry c : environment.commands.entrySet()) { + commands.add(c.getKey()); + } + reader.addCompleter(new StringsCompleter(commands)); + this.environment = environment; + } + + public Environment getEnvironment() { + return this.environment; + } + + /** + * @return the properties + */ + public String getProperty(String name) { + return properties.getProperty(name); + } + + /** + * @param name + * @param value + */ + public void setProperty(String name, Object value) { + properties.put(name, value); + } + + public void properties() { + for(Map.Entry entry : properties.entrySet()) { + System.out.printf("%25s = %55s",entry.getKey(), entry.getValue()); + } + } + + public void exit() { + if(environment.parent == null) { + System.out.println("Goodbye"); + System.exit(1); + } else { + environment = environment.parent; + } + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/Environment.java b/openstack-console/src/main/java/com/woorea/openstack/console/Environment.java new file mode 100644 index 000000000..ca0eee467 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/Environment.java @@ -0,0 +1,30 @@ +package com.woorea.openstack.console; +import java.util.Map; +import java.util.TreeMap; + + +public class Environment { + + protected final Environment parent; + + protected Map commands = new TreeMap(); + + public Environment(Environment parent) { + register(Commands.EXIT); + register(Commands.SET); + this.parent = parent; + } + + public Environment() { + this(null); + } + + public void register(Command command) { + commands.put(command.name, command); + } + + public String getPrompt() { + return "> "; + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/Main.java b/openstack-console/src/main/java/com/woorea/openstack/console/Main.java new file mode 100644 index 000000000..d469e5446 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/Main.java @@ -0,0 +1,27 @@ +package com.woorea.openstack.console; + +import java.io.FileInputStream; +import java.io.IOException; +import java.util.Properties; + +import com.woorea.openstack.console.keystone.KeystoneEnvironment; +import com.woorea.openstack.console.nova.NovaEnvironment; + +public class Main { + + /** + * @param args + */ + public static void main(String[] args) throws IOException { + Environment environment = new Environment(); + environment.register(KeystoneEnvironment.KEYSTONE); + environment.register(NovaEnvironment.NOVA); + + Properties properties = new Properties(); + properties.load(new FileInputStream("src/main/resources/console.properties")); + + Console console = new Console(environment, properties); + console.start(); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneCommand.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneCommand.java new file mode 100644 index 000000000..f15ad247d --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneCommand.java @@ -0,0 +1,24 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.Command; +import com.woorea.openstack.console.Console; +import com.woorea.openstack.keystone.Keystone; + +public abstract class KeystoneCommand extends Command { + + public KeystoneCommand(String name) { + super(name); + } + + @Override + public void execute(Console console, CommandLine args) { + KeystoneEnvironment environment = (KeystoneEnvironment) console.getEnvironment(); + execute(environment.CLIENT, args); + + } + + protected abstract void execute(Keystone keystone, CommandLine args); + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneEnvironment.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneEnvironment.java new file mode 100644 index 000000000..0d0a6a21b --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneEnvironment.java @@ -0,0 +1,63 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.console.Command; +import com.woorea.openstack.console.Console; +import com.woorea.openstack.console.Environment; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; + +public class KeystoneEnvironment extends Environment { + + public final Keystone CLIENT; + + public static final Command KEYSTONE = new Command("keystone") { + + @Override + public void execute(Console console, CommandLine args) { + + Keystone client = new Keystone(console.getProperty("keystone.endpoint")); + + Access access = client.tokens() + .authenticate(new UsernamePassword( + console.getProperty("keystone.username"), + console.getProperty("keystone.password") + )) + .withTenantName(console.getProperty("keystone.tenant_name")) + .execute(); + + client.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + KeystoneEnvironment environment = new KeystoneEnvironment(console.getEnvironment(), client); + + environment.register(new KeystoneTenantList()); + environment.register(new KeystoneTenantCreate()); + environment.register(new KeystoneTenantDelete()); + environment.register(new KeystoneUserList()); + environment.register(new KeystoneUserCreate()); + environment.register(new KeystoneUserDelete()); + environment.register(new KeystoneRoleList()); + environment.register(new KeystoneRoleDelete()); + environment.register(new KeystoneServiceList()); + console.setEnvironment(environment); + } + + }; + + public KeystoneEnvironment(Environment parent, Keystone client) { + super(parent); + CLIENT = client; + } + + /* (non-Javadoc) + * @see org.woorea.wsh.Environment#getPrompt() + */ + @Override + public String getPrompt() { + return "keystone> "; + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleCreate.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleCreate.java new file mode 100644 index 000000000..2acdd7649 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleCreate.java @@ -0,0 +1,69 @@ +package com.woorea.openstack.console.keystone; + +import java.util.Arrays; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Options; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Role; + +public class KeystoneRoleCreate extends KeystoneCommand { + + public KeystoneRoleCreate() { + super( "role-create"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + Role role = new Role(); + role.setName(cmd.getOptionValue("name")); + role.setDescription(cmd.getOptionValue("description")); + if(cmd.getOptionValue("enabled") != null) { + role.setEnabled("True"); + } + + role = keystone.roles().create(role).execute(); + + Table t = new Table(new TableModel(Arrays.asList(role)) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("name", 10, Column.ALIGN_LEFT), + new Column("description", 32, Column.ALIGN_LEFT), + new Column("enabled", 7, Column.ALIGN_LEFT) + }; + } + + @Override + public String[] getRow(Role tenant) { + return new String[]{ + tenant.getId(), + tenant.getName(), + tenant.getDescription(), + tenant.getEnabled().toString() + }; + } + }); + System.out.println(t.render()); + } + + /* (non-Javadoc) + * @see com.billingstack.commands.Command#getOptions() + */ + @Override + public Options getOptions() { + Options opts = super.getOptions(); + opts.addOption(null, "name", true, "tenant name"); + opts.addOption(null, "description", true, "tenant description"); + opts.addOption(null, "enabled", false, "enabled"); + return opts; + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleDelete.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleDelete.java new file mode 100644 index 000000000..d3977b73f --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleDelete.java @@ -0,0 +1,25 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.ConsoleUtils; +import com.woorea.openstack.keystone.Keystone; + +public class KeystoneRoleDelete extends KeystoneCommand { + + public KeystoneRoleDelete() { + super("role-delete"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + String[] args = cmd.getArgs(); + if(args.length == 1) { + keystone.roles().delete(args[0]).execute(); + System.out.println(new ConsoleUtils().green("OK")); + } + + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleList.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleList.java new file mode 100644 index 000000000..13b7175bf --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneRoleList.java @@ -0,0 +1,48 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Role; +import com.woorea.openstack.keystone.model.Roles; + +public class KeystoneRoleList extends KeystoneCommand { + + public KeystoneRoleList() { + super("role-list"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + final Roles roles = keystone.roles().list().execute(); + + Table t = new Table(new TableModel(roles.getList()) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("name", 10, Column.ALIGN_LEFT), + new Column("description", 32, Column.ALIGN_LEFT), + new Column("enabled", 7, Column.ALIGN_LEFT), + }; + } + + @Override + public String[] getRow(Role role) { + return new String[]{ + role.getId(), + role.getName(), + role.getDescription(), + role.getEnabled() + }; + } + }); + System.out.println(t.render()); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneServiceList.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneServiceList.java new file mode 100644 index 000000000..27542c13c --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneServiceList.java @@ -0,0 +1,48 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Service; +import com.woorea.openstack.keystone.model.Services; + +public class KeystoneServiceList extends KeystoneCommand { + + public KeystoneServiceList() { + super("service-list"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + final Services services = keystone.services().list().execute(); + + Table t = new Table(new TableModel(services.getList()) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("type", 10, Column.ALIGN_LEFT), + new Column("name", 10, Column.ALIGN_LEFT), + new Column("description", 32, Column.ALIGN_LEFT) + }; + } + + @Override + public String[] getRow(Service service) { + return new String[]{ + service.getId(), + service.getType(), + service.getName(), + service.getDescription() + }; + } + }); + System.out.println(t.render()); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantCreate.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantCreate.java new file mode 100644 index 000000000..a8336ead4 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantCreate.java @@ -0,0 +1,69 @@ +package com.woorea.openstack.console.keystone; + +import java.util.Arrays; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Options; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Tenant; + +public class KeystoneTenantCreate extends KeystoneCommand { + + public KeystoneTenantCreate() { + super("tenant-create"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + Tenant tenant = new Tenant(); + tenant.setName(cmd.getOptionValue("name")); + tenant.setDescription(cmd.getOptionValue("description")); + if(cmd.getOptionValue("enabled") != null) { + tenant.setEnabled(Boolean.TRUE); + } + + tenant = keystone.tenants().create(tenant).execute(); + + Table t = new Table(new TableModel(Arrays.asList(tenant)) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("name", 10, Column.ALIGN_LEFT), + new Column("description", 32, Column.ALIGN_LEFT), + new Column("enabled", 7, Column.ALIGN_LEFT) + }; + } + + @Override + public String[] getRow(Tenant tenant) { + return new String[]{ + tenant.getId(), + tenant.getName(), + tenant.getDescription(), + tenant.getEnabled().toString() + }; + } + }); + System.out.println(t.render()); + } + + /* (non-Javadoc) + * @see com.billingstack.commands.Command#getOptions() + */ + @Override + public Options getOptions() { + Options opts = super.getOptions(); + opts.addOption(null, "name", true, "tenant name"); + opts.addOption(null, "description", true, "tenant description"); + opts.addOption(null, "enabled", false, "enabled"); + return opts; + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantDelete.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantDelete.java new file mode 100644 index 000000000..a79da6a26 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantDelete.java @@ -0,0 +1,25 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.ConsoleUtils; +import com.woorea.openstack.keystone.Keystone; + +public class KeystoneTenantDelete extends KeystoneCommand { + + public KeystoneTenantDelete() { + super("tenant-delete"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + String[] args = cmd.getArgs(); + if(args.length == 1) { + keystone.tenants().delete(args[0]).execute(); + System.out.println(new ConsoleUtils().green("OK")); + } + + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantList.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantList.java new file mode 100644 index 000000000..24ff73bf9 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneTenantList.java @@ -0,0 +1,48 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Tenant; +import com.woorea.openstack.keystone.model.Tenants; + +public class KeystoneTenantList extends KeystoneCommand { + + public KeystoneTenantList() { + super("tenant-list"); + } + + @Override + public void execute(Keystone keystone, CommandLine args) { + + final Tenants tenants = keystone.tenants().list().execute(); + + Table t = new Table(new TableModel(tenants.getList()) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("name", 32, Column.ALIGN_LEFT), + new Column("description", 32, Column.ALIGN_LEFT), + new Column("enabled", 7, Column.ALIGN_LEFT) + }; + } + + @Override + public String[] getRow(Tenant tenant) { + return new String[]{ + tenant.getId(), + tenant.getName(), + tenant.getDescription(), + tenant.getEnabled().toString() + }; + } + }); + System.out.println(t.render()); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserCreate.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserCreate.java new file mode 100644 index 000000000..262876763 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserCreate.java @@ -0,0 +1,75 @@ +package com.woorea.openstack.console.keystone; + +import java.util.Arrays; + +import org.apache.commons.cli.CommandLine; +import org.apache.commons.cli.Options; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.User; + +public class KeystoneUserCreate extends KeystoneCommand { + + public KeystoneUserCreate() { + super("user-create"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + User user = new User(); + user.setName(cmd.getOptionValue("name")); + user.setPassword(cmd.getOptionValue("password")); + user.setEmail(cmd.getOptionValue("email")); + user.setTenantId(cmd.getOptionValue("tenant")); + if(cmd.getOptionValue("enabled") != null) { + user.setEnabled(Boolean.TRUE); + } + + user = keystone.users().create(user).execute(); + + Table t = new Table(new TableModel(Arrays.asList(user)) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("name", 10, Column.ALIGN_LEFT), + new Column("email", 22, Column.ALIGN_LEFT), + new Column("tenant", 32, Column.ALIGN_LEFT), + new Column("enabled", 7, Column.ALIGN_LEFT) + }; + } + + @Override + public String[] getRow(User user) { + return new String[]{ + user.getId(), + user.getName(), + user.getEmail(), + user.getTenantId(), + user.getEnabled().toString() + }; + } + }); + System.out.println(t.render()); + } + + /* (non-Javadoc) + * @see com.billingstack.commands.Command#getOptions() + */ + @Override + public Options getOptions() { + Options opts = super.getOptions(); + opts.addOption(null, "name", true, "user name"); + opts.addOption(null, "password", true, "user password"); + opts.addOption(null, "email", true, "user email"); + opts.addOption(null, "tenant", true, "tenant id"); + opts.addOption(null, "enabled", false, "enabled"); + return opts; + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserDelete.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserDelete.java new file mode 100644 index 000000000..77deff4b2 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserDelete.java @@ -0,0 +1,25 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.ConsoleUtils; +import com.woorea.openstack.keystone.Keystone; + +public class KeystoneUserDelete extends KeystoneCommand { + + public KeystoneUserDelete() { + super("user-delete"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + String[] args = cmd.getArgs(); + if(args.length == 1) { + keystone.users().delete(args[0]).execute(); + System.out.println(new ConsoleUtils().green("OK")); + } + + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserList.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserList.java new file mode 100644 index 000000000..90bcde427 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserList.java @@ -0,0 +1,50 @@ +package com.woorea.openstack.console.keystone; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.User; +import com.woorea.openstack.keystone.model.Users; + +public class KeystoneUserList extends KeystoneCommand { + + public KeystoneUserList() { + super("user-list"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + final Users users = keystone.users().list().execute(); + + Table t = new Table(new TableModel(users.getList()) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("name", 10, Column.ALIGN_LEFT), + new Column("email", 22, Column.ALIGN_LEFT), + new Column("tenant", 32, Column.ALIGN_LEFT), + new Column("enabled", 7, Column.ALIGN_LEFT) + }; + } + + @Override + public String[] getRow(User user) { + return new String[]{ + user.getId(), + user.getName(), + user.getEmail(), + user.getTenantId(), + user.getEnabled().toString() + }; + } + }); + System.out.println(t.render()); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserShow.java b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserShow.java new file mode 100644 index 000000000..29a447f4e --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/keystone/KeystoneUserShow.java @@ -0,0 +1,53 @@ +package com.woorea.openstack.console.keystone; + +import java.util.Arrays; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.User; + +public class KeystoneUserShow extends KeystoneCommand { + + public KeystoneUserShow() { + super("user-show"); + } + + @Override + public void execute(Keystone keystone, CommandLine cmd) { + + String[] args = cmd.getArgs(); + if(args.length == 1) { + User user = keystone.users().show(args[0]).execute(); + Table t = new Table(new TableModel(Arrays.asList(user)) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("name", 10, Column.ALIGN_LEFT), + new Column("email", 22, Column.ALIGN_LEFT), + new Column("tenant", 32, Column.ALIGN_LEFT), + new Column("enabled", 7, Column.ALIGN_LEFT) + }; + } + + @Override + public String[] getRow(User user) { + return new String[]{ + user.getId(), + user.getName(), + user.getEmail(), + user.getTenantId(), + user.getEnabled().toString() + }; + } + }); + System.out.println(t.render()); + } + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaCommand.java b/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaCommand.java new file mode 100644 index 000000000..b406fbcbc --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaCommand.java @@ -0,0 +1,25 @@ +package com.woorea.openstack.console.nova; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.Command; +import com.woorea.openstack.console.Console; +import com.woorea.openstack.nova.Nova; + + +public abstract class NovaCommand extends Command { + + public NovaCommand(String name) { + super(name); + } + + @Override + public void execute(Console console, CommandLine args) { + NovaEnvironment environment = (NovaEnvironment) console.getEnvironment(); + execute(environment.CLIENT, args); + + } + + protected abstract void execute(Nova nova, CommandLine args); + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaEnvironment.java b/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaEnvironment.java new file mode 100644 index 000000000..bb2e5c4bd --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaEnvironment.java @@ -0,0 +1,65 @@ +package com.woorea.openstack.console.nova; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.console.Command; +import com.woorea.openstack.console.Console; +import com.woorea.openstack.console.Environment; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.nova.Nova; + +public class NovaEnvironment extends Environment { + + public final Nova CLIENT; + + public static final Command NOVA = new Command("nova") { + + @Override + public void execute(Console console, CommandLine args) { + + if(args.getArgs().length == 1) { + Keystone keystone = new Keystone((String) console.getProperty("keystone.endpoint")); + + Access access = keystone.tokens().authenticate( + new UsernamePassword( + console.getProperty("keystone.username"), + console.getProperty("keystone.password") + ) + ) + .withTenantName(console.getProperty("keystone.tenant_name")) + .execute(); + + System.out.println(console.getProperty("nova.endpoint")); + + Nova client = new Nova(console.getProperty("nova.endpoint")+args.getArgs()[0]); + client.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + NovaEnvironment environment = new NovaEnvironment(console.getEnvironment(), client); + + environment.register(new NovaServerList()); + + console.setEnvironment(environment); + + } + + } + + }; + + public NovaEnvironment(Environment parent, Nova client) { + super(parent); + CLIENT = client; + } + + /* (non-Javadoc) + * @see org.woorea.wsh.Environment#getPrompt() + */ + @Override + public String getPrompt() { + return "nova> "; + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaServerList.java b/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaServerList.java new file mode 100644 index 000000000..515ca2b19 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/nova/NovaServerList.java @@ -0,0 +1,44 @@ +package com.woorea.openstack.console.nova; + +import org.apache.commons.cli.CommandLine; + +import com.woorea.openstack.console.utils.Column; +import com.woorea.openstack.console.utils.Table; +import com.woorea.openstack.console.utils.TableModel; +import com.woorea.openstack.nova.Nova; +import com.woorea.openstack.nova.model.Server; +import com.woorea.openstack.nova.model.Servers; + +public class NovaServerList extends NovaCommand { + + public NovaServerList() { + super("list"); + } + + @Override + public void execute(Nova nova, CommandLine cmd) { + + final Servers servers = nova.servers().list(true).execute(); + + Table t = new Table(new TableModel(servers.getList()) { + + @Override + public Column[] getHeaders() { + return new Column[]{ + new Column("id", 32, Column.ALIGN_LEFT), + new Column("name", 10, Column.ALIGN_LEFT) + }; + } + + @Override + public String[] getRow(Server server) { + return new String[]{ + server.getId(), + server.getName() + }; + } + }); + System.out.println(t.render()); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/utils/Column.java b/openstack-console/src/main/java/com/woorea/openstack/console/utils/Column.java new file mode 100644 index 000000000..08ffa19e0 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/utils/Column.java @@ -0,0 +1,65 @@ +package com.woorea.openstack.console.utils; + +public class Column { + + public static final int ALIGN_LEFT = -1; + public static final int ALIGN_RIGHT = 1; + + private String name; + + private int size; + + private int align; + + public Column(String name, int size, int align) { + super(); + this.name = name; + this.size = size; + this.align = align; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the size + */ + public int getSize() { + return size; + } + + /** + * @param size the size to set + */ + public void setSize(int size) { + this.size = size; + } + + /** + * @return the align + */ + public int getAlign() { + return align; + } + + /** + * @param align the align to set + */ + public void setAlign(int align) { + this.align = align; + } + + + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/utils/ConsoleUtils.java b/openstack-console/src/main/java/com/woorea/openstack/console/utils/ConsoleUtils.java new file mode 100644 index 000000000..8212db693 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/utils/ConsoleUtils.java @@ -0,0 +1,47 @@ +package com.woorea.openstack.console.utils; + +public class ConsoleUtils { + + public static final String RED = "\u001B[31m"; + + public static final String GREEN = "\u001B[32m"; + + public static final String YELLOW = "\u001B[33m"; + + public static final String END = "\u001B[0m"; + + private StringBuilder sb = new StringBuilder(); + + public ConsoleUtils append(String text) { + sb.append(text); + return this; + } + + public ConsoleUtils red(String text) { + sb.append(ConsoleUtils.RED).append(text).append(END); + return this; + } + + public ConsoleUtils green(String text) { + sb.append(ConsoleUtils.GREEN).append(text).append(END); + return this; + } + + public ConsoleUtils yellow(String text) { + sb.append(ConsoleUtils.YELLOW).append(text).append(END); + return this; + } + + public static void log(String text) { + System.out.println(new ConsoleUtils().yellow("| ").append(text)); + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return sb.toString(); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/utils/Table.java b/openstack-console/src/main/java/com/woorea/openstack/console/utils/Table.java new file mode 100644 index 000000000..b49ede581 --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/utils/Table.java @@ -0,0 +1,81 @@ +package com.woorea.openstack.console.utils; + + +public class Table { + + private StringBuilder sb = new StringBuilder(); + + private TableModel model; + + public Table(TableModel model) { + this.model = model; + } + + public StringBuilder render() { + header(); + for(String[] row : model.getRows()) { + int i = 0; + for(String column : row) { + Column columnModel = model.getHeaders()[i]; + sb.append("| "); + if(column != null) { + if(Column.ALIGN_RIGHT == columnModel.getAlign()) { + for(int j = 0; j < columnModel.getSize() - column.length(); j++) { + sb.append(" "); + } + } + sb.append(column.length() <= columnModel.getSize() ? column : column.substring(0, columnModel.getSize())); + if(Column.ALIGN_LEFT == columnModel.getAlign()) { + for(int j = 0; j < columnModel.getSize() - column.length(); j++) { + sb.append(" "); + } + } + } else { + for(int k = 0; k < columnModel.getSize(); k++) { + sb.append(" "); + } + } + sb.append(" "); + i++; + } + sb.append("|\n"); + } + for(Column c : model.getHeaders()) { + sb.append("+"); + for(int i = 0; i < c.getSize() + 2; i++) { + sb.append("-"); + } + } + sb.append("+\n"); + return sb; + } + + public void header() { + for(Column c : model.getHeaders()) { + sb.append("+"); + for(int i = 0; i < c.getSize() + 2; i++) { + sb.append("-"); + } + } + sb.append("+\n"); + + for(Column c : model.getHeaders()) { + sb.append("| "); + sb.append(c.getName()); + for(int i = 0; i < c.getSize() - c.getName().length(); i++) { + sb.append(" "); + } + sb.append(" "); + } + sb.append("|\n"); + + for(Column c : model.getHeaders()) { + sb.append("+"); + for(int i = 0; i < c.getSize() + 2; i++) { + sb.append("-"); + } + } + sb.append("+\n"); + } + +} diff --git a/openstack-console/src/main/java/com/woorea/openstack/console/utils/TableModel.java b/openstack-console/src/main/java/com/woorea/openstack/console/utils/TableModel.java new file mode 100644 index 000000000..f1ae84abf --- /dev/null +++ b/openstack-console/src/main/java/com/woorea/openstack/console/utils/TableModel.java @@ -0,0 +1,25 @@ +package com.woorea.openstack.console.utils; + +import java.util.List; + +public abstract class TableModel { + + protected List data; + + public TableModel(List data) { + this.data = data; + } + + public abstract Column[] getHeaders(); + + public final String[][] getRows() { + String[][] rows = new String[data.size()][]; + for(int i = 0; i < data.size(); i++) { + rows[i] = getRow(data.get(i)); + } + return rows; + } + + public abstract String[] getRow(T data); + +} diff --git a/openstack-console/src/main/resources/console.properties b/openstack-console/src/main/resources/console.properties new file mode 100644 index 000000000..01902e4d9 --- /dev/null +++ b/openstack-console/src/main/resources/console.properties @@ -0,0 +1,6 @@ +keystone.endpoint=http://keystone.stacksherpa.org/v2.0 +keystone.username=admin +keystone.password=secret0 +keystone.tenant_name=admin + +nova.endpoint=http://compute/v2/ \ No newline at end of file diff --git a/openstack-examples/pom.xml b/openstack-examples/pom.xml new file mode 100644 index 000000000..b9bb31134 --- /dev/null +++ b/openstack-examples/pom.xml @@ -0,0 +1,87 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + + UTF-8 + 3.2.8 + + openstack-examples + OpenStack Examples + OpenStack Examples + + + com.woorea + keystone-client + ${openstack-sdk.version} + + + com.woorea + nova-client + ${openstack-sdk.version} + + + com.woorea + heat-client + ${openstack-sdk.version} + + + com.woorea + swift-client + ${openstack-sdk.version} + + + com.woorea + quantum-client + ${openstack-sdk.version} + + + com.woorea + ceilometer-client + ${openstack-sdk.version} + + + com.woorea + glance-client + ${openstack-sdk.version} + + + + + jersey + + + com.woorea + jersey-connector + ${openstack-sdk.version} + + + + + jersey2 + + true + + + + com.woorea + jersey2-connector + ${openstack-sdk.version} + + + + + resteasy + + + com.woorea + resteasy-connector + ${openstack-sdk.version} + + + + + diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/ExamplesConfiguration.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/ExamplesConfiguration.java new file mode 100644 index 000000000..056eae52b --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/ExamplesConfiguration.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.examples; + + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Tenant; + +public class ExamplesConfiguration { + + public static final String KEYSTONE_AUTH_URL = "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v3"; + + public static final String KEYSTONE_USERNAME = ""; + + public static final String KEYSTONE_PASSWORD = ""; + + public static final String KEYSTONE_ENDPOINT = "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v3"; + + public static final String TENANT_NAME = "admin"; + + public static final String NOVA_ENDPOINT = "http://compute/v2"; + + public static final String CEILOMETER_ENDPOINT = ""; + + public static void main(String[] args) { + Keystone client = new Keystone(KEYSTONE_ENDPOINT); + client.setTokenProvider(new OpenStackSimpleTokenProvider("secret0")); + client.tenants().delete("36c481aec1d54fc49190c92c3ef6840a").execute(); + Tenant tenant = client.tenants().create(new Tenant("new_api")).execute(); + System.out.println(tenant); + System.out.println(client.tenants().list().execute()); + client.tenants().delete(tenant.getId()).execute(); + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaCreateServer.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaCreateServer.java new file mode 100644 index 000000000..643f14b9e --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaCreateServer.java @@ -0,0 +1,90 @@ +package com.woorea.openstack.examples.compute; + + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Tenants; +import com.woorea.openstack.nova.Nova; +import com.woorea.openstack.nova.model.Flavors; +import com.woorea.openstack.nova.model.Images; +import com.woorea.openstack.nova.model.KeyPairs; +import com.woorea.openstack.nova.model.Server; +import com.woorea.openstack.nova.model.ServerForCreate; + +public class NovaCreateServer { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + // access with unscoped token + Access access = keystone + .tokens() + .authenticate() + .withUsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD) + .execute(); + + // use the token in the following requests + keystone.token(access.getToken().getId()); + + Tenants tenants = keystone.tenants().list().execute(); + + // try to exchange token using the first tenant + if (tenants.getList().size() > 0) { + + access = keystone.tokens().authenticate() + .withToken(access.getToken().getId()) + .withTenantId(tenants.getList().get(0).getId()).execute(); + + // NovaClient novaClient = new + // NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), + // "compute", null, "public"), access.getToken().getId()); + Nova nova = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat(tenants + .getList().get(0).getId())); + nova.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken() + .getId())); + // novaClient.enableLogging(Logger.getLogger("nova"), 100 * 1024); + // create a new keypair + // KeyPair keyPair = + // novaClient.execute(KeyPairsExtension.createKeyPair("mykeypair")); + // System.out.println(keyPair.getPrivateKey()); + + // create security group + // SecurityGroup securityGroup = + // novaClient.execute(SecurityGroupsExtension.createSecurityGroup("mysecuritygroup", + // "description")); + + // novaClient.execute(SecurityGroupsExtension.createSecurityGroupRule(securityGroup.getId(), + // "UDP", 9090, 9092, "0.0.0.0/0")); + // novaClient.execute(SecurityGroupsExtension.createSecurityGroupRule(securityGroup.getId(), + // "TCP", 8080, 8080, "0.0.0.0/0")); + + KeyPairs keysPairs = nova.keyPairs().list().execute(); + + Images images = nova.images().list(true).execute(); + + Flavors flavors = nova.flavors().list(true).execute(); + + ServerForCreate serverForCreate = new ServerForCreate(); + serverForCreate.setName("woorea"); + serverForCreate.setFlavorRef(flavors.getList().get(0).getId()); + serverForCreate.setImageRef(images.getList().get(1).getId()); + serverForCreate.setKeyName(keysPairs.getList().get(0).getName()); + serverForCreate.getSecurityGroups() + .add(new ServerForCreate.SecurityGroup("default")); + // serverForCreate.getSecurityGroups().add(new + // ServerForCreate.SecurityGroup(securityGroup.getName())); + + Server server = nova.servers().boot(serverForCreate).execute(); + System.out.println(server); + + } else { + System.out.println("No tenants found!"); + } + + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListFlavors.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListFlavors.java new file mode 100644 index 000000000..893192d2a --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListFlavors.java @@ -0,0 +1,51 @@ +package com.woorea.openstack.examples.compute; + + +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Tenants; +import com.woorea.openstack.keystone.model.authentication.TokenAuthentication; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.nova.Nova; +import com.woorea.openstack.nova.model.Flavor; +import com.woorea.openstack.nova.model.Flavors; + +public class NovaListFlavors { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + Access access = keystone.tokens().authenticate( + new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .execute(); + + //use the token in the following requests + keystone.token(access.getToken().getId()); + + Tenants tenants = keystone.tenants().list().execute(); + + //try to exchange token using the first tenant + if(tenants.getList().size() > 0) { + + access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute(); + + //NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId()); + Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(tenants.getList().get(0).getId())); + novaClient.token(access.getToken().getId()); + //novaClient.enableLogging(Logger.getLogger("nova"), 100 * 1024); + + Flavors flavors = novaClient.flavors().list(true).execute(); + for(Flavor flavor : flavors) { + System.out.println(flavor); + } + + } else { + System.out.println("No tenants found!"); + } + + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListImages.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListImages.java new file mode 100644 index 000000000..edf2f63d1 --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListImages.java @@ -0,0 +1,52 @@ +package com.woorea.openstack.examples.compute; + + +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Tenants; +import com.woorea.openstack.keystone.model.authentication.TokenAuthentication; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.nova.Nova; +import com.woorea.openstack.nova.model.Image; +import com.woorea.openstack.nova.model.Images; + +public class NovaListImages { + + /** + * @param args + */ + public static void main(String[] args) { + + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + Access access = keystone.tokens().authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)).execute(); + + //use the token in the following requests + keystone.token(access.getToken().getId()); + + Tenants tenants = keystone.tenants().list().execute(); + + //try to exchange token using the first tenant + if(tenants.getList().size() > 0) { + + access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())) + .withTenantId(tenants.getList().get(0).getId()) + .execute(); + + //NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId()); + Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(tenants.getList().get(0).getId())); + novaClient.token(access.getToken().getId()); + //novaClient.enableLogging(Logger.getLogger("nova"), 100 * 1024); + + Images images = novaClient.images().list(true).execute(); + for(Image image : images) { + System.out.println(image); + } + + } else { + System.out.println("No tenants found!"); + } + + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListServers.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListServers.java new file mode 100644 index 000000000..cab24e1ca --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaListServers.java @@ -0,0 +1,38 @@ +package com.woorea.openstack.examples.compute; + + +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.nova.Nova; +import com.woorea.openstack.nova.model.Server; +import com.woorea.openstack.nova.model.Servers; + +public class NovaListServers { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + Access access = keystone.tokens().authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .withTenantName("demo") + .execute(); + + //use the token in the following requests + keystone.token(access.getToken().getId()); + + //NovaClient novaClient = new NovaClient(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "compute", null, "public"), access.getToken().getId()); + Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(access.getToken().getTenant().getId())); + novaClient.token(access.getToken().getId()); + //novaClient.enableLogging(Logger.getLogger("nova"), 100 * 1024); + + Servers servers = novaClient.servers().list(true).execute(); + for(Server server : servers) { + System.out.println(server); + } + + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaStopStartServer.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaStopStartServer.java new file mode 100644 index 000000000..df4d44b7c --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/compute/NovaStopStartServer.java @@ -0,0 +1,40 @@ +package com.woorea.openstack.examples.compute; + +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.nova.Nova; +import com.woorea.openstack.nova.api.ServersResource; +import com.woorea.openstack.nova.model.Servers; + +public class NovaStopStartServer { + public static void main(String[] args) throws InterruptedException { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + Access access = keystone.tokens().authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .withTenantName(ExamplesConfiguration.TENANT_NAME) + .execute(); + + //use the token in the following requests + keystone.token(access.getToken().getId()); + + Nova novaClient = new Nova(ExamplesConfiguration.NOVA_ENDPOINT.concat("/").concat(access.getToken().getTenant().getId())); + novaClient.token(access.getToken().getId()); + + Servers servers = novaClient.servers().list(true).execute(); + if(servers.getList().size() > 0) { + + // Server has to be in activated state. + ServersResource.StopServer stopServer = novaClient.servers().stop(servers.getList().get(0).getId()); + stopServer.endpoint(ExamplesConfiguration.NOVA_ENDPOINT); + stopServer.execute(); + + // Wait until server shutdown. Or 400 error occurs. + Thread.sleep(5000); + + ServersResource.StartServer startServer = novaClient.servers().start(servers.getList().get(0).getId()); + startServer.endpoint(ExamplesConfiguration.NOVA_ENDPOINT); + startServer.execute(); + } + } +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/glance/GlanceListImages.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/glance/GlanceListImages.java new file mode 100644 index 000000000..ea687aaf8 --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/glance/GlanceListImages.java @@ -0,0 +1,83 @@ +package com.woorea.openstack.examples.glance; + +import com.woorea.openstack.glance.model.ImageDownload; +import com.woorea.openstack.glance.model.ImageUpload; +import com.woorea.openstack.keystone.utils.KeystoneTokenProvider; + +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.glance.Glance; +import com.woorea.openstack.glance.model.Image; +import com.woorea.openstack.glance.model.Images; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Access.Service; +import com.woorea.openstack.keystone.model.Access.Service.Endpoint; + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +public class GlanceListImages { + + protected static String IMAGE_CONTENT = "Hello World!"; + + /** + * @param args + */ + public static void main(String[] args) { + KeystoneTokenProvider keystone = new KeystoneTokenProvider( + ExamplesConfiguration.KEYSTONE_AUTH_URL, + ExamplesConfiguration.KEYSTONE_USERNAME, + ExamplesConfiguration.KEYSTONE_PASSWORD); + + Access access = keystone.getAccessByTenant(ExamplesConfiguration.TENANT_NAME); + + Service glanceService = null; + + for (Service service : access.getServiceCatalog()) { + if (service.getType().equals("image")) { + glanceService = service; + break; + } + } + + if (glanceService == null) { + throw new RuntimeException("Glance service not found"); + } + + for (Endpoint endpoint : glanceService.getEndpoints()) { + Glance glance = new Glance(endpoint.getPublicURL() + "/v1"); + glance.setTokenProvider(keystone + .getProviderByTenant(ExamplesConfiguration.TENANT_NAME)); + + // Creating a new image + Image newImage = new Image(); + newImage.setDiskFormat("raw"); + newImage.setContainerFormat("bare"); + newImage.setName("os-java-glance-test"); + newImage = glance.images().create(newImage).execute(); + + // Uploading image + ImageUpload uploadImage = new ImageUpload(newImage); + uploadImage.setInputStream(new ByteArrayInputStream(IMAGE_CONTENT.getBytes())); + glance.images().upload(newImage.getId(), uploadImage).execute(); + + // Downloading the image and displaying the image content + try { + byte[] imgContent = new byte[IMAGE_CONTENT.length()]; + ImageDownload downloadImage = glance.images().download(newImage.getId()).execute(); + downloadImage.getInputStream().read(imgContent, 0, imgContent.length); + System.out.println(new String(imgContent)); + } catch (IOException e) { + e.printStackTrace(); + } + + Images images = glance.images().list(false).execute(); + + for (Image image : images) { + System.out.println(glance.images().show(image.getId()).execute()); + } + + glance.images().delete(newImage.getId()).execute(); + } + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/heat/HeatListStacks.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/heat/HeatListStacks.java new file mode 100644 index 000000000..75178c886 --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/heat/HeatListStacks.java @@ -0,0 +1,72 @@ +package com.woorea.openstack.examples.heat; + +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.heat.Heat; +import com.woorea.openstack.heat.model.CreateStackParam; +import com.woorea.openstack.heat.model.Stack; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.utils.KeystoneTokenProvider; +import com.woorea.openstack.keystone.utils.KeystoneUtils; + +import java.util.Collections; + +public class HeatListStacks { + + private static String TEMPLATE = "{\n" + + " \"HeatTemplateFormatVersion\": \"2012-12-12\",\n" + + " \"Parameters\": {},\n" + + " \"Mappings\": {},\n" + + " \"Resources\": {\n" + + " \"my-test-server\": {\n" + + " \"Type\": \"OS::Nova::Server\",\n" + + " \"Properties\": {\n" + + " \"flavor\": \"m1.small\",\n" + + " \"image\": \"centos:latest\"\n" + + " }\n" + + " }\n" + + " }\n" + + "}"; + + /** + * @param args + */ + public static void main(String[] args) throws InterruptedException { + KeystoneTokenProvider keystone = new KeystoneTokenProvider( + ExamplesConfiguration.KEYSTONE_ENDPOINT, + ExamplesConfiguration.KEYSTONE_USERNAME, + ExamplesConfiguration.KEYSTONE_PASSWORD + ); + + Access access = keystone.getAccessByTenant(ExamplesConfiguration.TENANT_NAME); + + String endpointURL = KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "orchestration", null, "public"); + + + Heat heat = new Heat(endpointURL); + heat.setTokenProvider(keystone + .getProviderByTenant(ExamplesConfiguration.TENANT_NAME)); + + CreateStackParam param = new CreateStackParam(); + param.setStackName("helloWorld"); + param.setTimeoutMinutes(1); + param.setParameters(Collections.emptyMap()); + param.setTemplate(TEMPLATE); + + System.out.printf("Create: " + heat.getStacks().create(param).execute()); + Thread.sleep(3000); + + for (Stack s : heat.getStacks().list().execute()) { + System.out.println(s.getDescription()); + System.out.println(s.getId()); + System.out.println(s.getStackName()); + System.out.println(s.getStackStatus()); + System.out.println(s.getCreationTime()); + System.out.println(s.getUpdatedTime()); + System.out.println(s.getLinks()); + + System.out.println(heat.getStacks().byName(s.getStackName()).execute()); + + + } + } +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/hpcloud/Keystone3Authentication.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/hpcloud/Keystone3Authentication.java new file mode 100644 index 000000000..5481a154a --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/hpcloud/Keystone3Authentication.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.examples.hpcloud; + + +import com.woorea.openstack.base.client.OpenStackResponse; +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.v3.model.Authentication; +import com.woorea.openstack.keystone.v3.model.Authentication.Identity; +import com.woorea.openstack.keystone.v3.Keystone; +import com.woorea.openstack.keystone.v3.model.Token; + +public class Keystone3Authentication { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + + Authentication auth = new Authentication(); + auth.setIdentity(Identity.password(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)); + + OpenStackResponse response = keystone.tokens().authenticate(auth).request(); + + String tokenId = response.header("X-Subject-Token"); + + Token token = response.getEntity(Token.class); + + System.out.println(tokenId); + + System.out.println(token); + + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/hpcloud/KeystoneAuthentication.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/hpcloud/KeystoneAuthentication.java new file mode 100644 index 000000000..1caffea6e --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/hpcloud/KeystoneAuthentication.java @@ -0,0 +1,29 @@ +package com.woorea.openstack.examples.hpcloud; + + +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; + +public class KeystoneAuthentication { + + private static final String KEYSTONE_AUTH_URL = "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0"; + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(KEYSTONE_AUTH_URL); + + // access with unscoped token + Access access = keystone + .tokens() + .authenticate() + .withUsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD) + .execute(); + + System.out.println(access); + + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateTenant.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateTenant.java new file mode 100644 index 000000000..9bd33990b --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateTenant.java @@ -0,0 +1,36 @@ +package com.woorea.openstack.examples.keystone; + + +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Tenant; +import com.woorea.openstack.keystone.model.authentication.TokenAuthentication; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; + +public class KeystoneCreateTenant { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + //access with unscoped token + Access access = keystone.tokens().authenticate( + new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .execute(); + + access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantName("admin").execute(); + + Tenant tenant = new Tenant(); + tenant.setName("benn.cs"); + tenant.setDescription("benn.cs"); + tenant.setEnabled(true); + //Get the adminURL client and use the token got above + keystone = new Keystone("http://keystone.x.org/v2.0"); + keystone.token(access.getToken().getId()); + tenant = keystone.tenants().create(tenant).execute(); + System.out.println(tenant); + keystone.tenants().delete(tenant.getId()); + } +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java new file mode 100644 index 000000000..bde24407a --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/keystone/KeystoneCreateUser.java @@ -0,0 +1,38 @@ +package com.woorea.openstack.examples.keystone; + + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.User; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; + +public class KeystoneCreateUser { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + //access with unscoped token + Access access = keystone.tokens() + .authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .withTenantName("admin") + .execute(); + + User user = new User(); + user.setEmail("luis@woorea.es"); + user.setUsername("luis.gervaso"); + user.setPassword("password.0"); + user.setName("Luis"); + user.setEnabled(Boolean.TRUE); + + keystone = new Keystone("http://keystone.x.org/v2.0"); + keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + //keystone.enableLogging(Logger.getLogger("keystone"), 10000); + user = keystone.users().create(user).execute(); + System.out.println(user); + keystone.users().delete(user.getId()).execute(); + } +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/metering/v2/TestAll.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/metering/v2/TestAll.java new file mode 100644 index 000000000..c9d0c1817 --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/metering/v2/TestAll.java @@ -0,0 +1,62 @@ +package com.woorea.openstack.examples.metering.v2; + +import java.util.List; + + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.ceilometer.Ceilometer; +import com.woorea.openstack.ceilometer.v2.model.Meter; +import com.woorea.openstack.ceilometer.v2.model.Statistics; +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; + +public class TestAll { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + Access access = keystone.tokens() + .authenticate(new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .withTenantName("admin") + .execute(); + + Ceilometer ceilometer = new Ceilometer(ExamplesConfiguration.CEILOMETER_ENDPOINT); + ceilometer.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + /* + List resources = ceilometer.execute(new ResourceList().eq("resource_id", "23b55841eedd41e99d5f3f32149ca086")); + + + for(Resource r : resources) { + Resource resource = ceilometer.execute(new ResourceShow().id(r.getResource())); + } + */ + + /* + //List meters = ceilometer.meters().list().execute(); //execute(new MeterList().eq("project_id", "948eeb593acd4223ad572c49e1ef5709")); + + + for(Meter m : meters) { + System.out.println(m); + +// List samples = ceilometer.execute(new MeterShow().name(m.getName())); +// for(Sample s : samples) { +// System.out.println("\t" + s); +// } + + List stats = ceilometer.meters().statistics().execute(); // (new MeterStatistics().name(m.getName())); + for(Statistics s : stats) { + System.out.println("\t\t" + s); + } + + + } + */ + + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumListNetworks.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumListNetworks.java new file mode 100644 index 000000000..8e218c25b --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumListNetworks.java @@ -0,0 +1,47 @@ +package com.woorea.openstack.examples.network; + +import com.woorea.openstack.keystone.utils.KeystoneUtils; + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Tenants; +import com.woorea.openstack.keystone.model.authentication.TokenAuthentication; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.quantum.Quantum; +import com.woorea.openstack.quantum.model.Network; +import com.woorea.openstack.quantum.model.Networks; + +public class QuantumListNetworks { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + // access with unscoped token + Access access = keystone.tokens().authenticate( + new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .execute(); + // use the token in the following requests + keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + Tenants tenants = keystone.tenants().list().execute(); + // try to exchange token using the first tenant + if (tenants.getList().size() > 0) { + // access with tenant + access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute(); + + Quantum quantum = new Quantum(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "network", null, "public")); + quantum.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + Networks networks = quantum.networks().list().execute(); + for (Network network : networks) { + System.out.println(network); + } + } else { + System.out.println("No tenants found!"); + } + } +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumNetworkCreate.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumNetworkCreate.java new file mode 100644 index 000000000..7f4dff08c --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumNetworkCreate.java @@ -0,0 +1,108 @@ +package com.woorea.openstack.examples.network; + +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +import com.woorea.openstack.keystone.utils.KeystoneUtils; + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Tenant; +import com.woorea.openstack.keystone.model.Tenants; +import com.woorea.openstack.keystone.model.authentication.TokenAuthentication; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.quantum.Quantum; +import com.woorea.openstack.quantum.api.NetworksResource; +import com.woorea.openstack.quantum.api.NetworksResource.Create; +import com.woorea.openstack.quantum.model.Network; +import com.woorea.openstack.quantum.model.NetworkForCreate; +import com.woorea.openstack.quantum.model.Networks; +import com.woorea.openstack.quantum.model.Port; +import com.woorea.openstack.quantum.model.PortForCreate; +import com.woorea.openstack.quantum.model.Router; +import com.woorea.openstack.quantum.model.RouterForAddInterface; +import com.woorea.openstack.quantum.model.RouterForCreate; +import com.woorea.openstack.quantum.model.Subnet; +import com.woorea.openstack.quantum.model.SubnetForCreate; +import com.woorea.openstack.quantum.model.Subnets; + +public class QuantumNetworkCreate { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone( + ExamplesConfiguration.KEYSTONE_AUTH_URL); + // access with unscoped token + Access access = keystone + .tokens() + .authenticate( + new UsernamePassword( + ExamplesConfiguration.KEYSTONE_USERNAME, + ExamplesConfiguration.KEYSTONE_PASSWORD)) + .execute(); + // use the token in the following requests + keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access + .getToken().getId())); + keystone.token(access.getToken().getId()); + Tenants tenants = keystone.tenants().list().execute(); + // try to exchange token using the first tenant + + if (tenants.getList().size() > 0) { + // access with tenant + Network network = new Network(); + access = keystone + .tokens() + .authenticate( + new TokenAuthentication(access.getToken().getId())) + .withTenantId("tenantId").execute(); + Quantum quantum = new Quantum(KeystoneUtils.findEndpointURL( + access.getServiceCatalog(), "network", null, "public")); + quantum.setTokenProvider(new OpenStackSimpleTokenProvider(access + .getToken().getId())); + NetworkForCreate netcreate = new NetworkForCreate(); + netcreate.setTenantId("tenantId"); + netcreate.setName("net2"); + netcreate.setAdminStateUp(true); + + network = quantum.networks().create(netcreate).execute(); + + // Creating Subnet + try { + Subnet sub = new Subnet(); + SubnetForCreate subnet = new SubnetForCreate(); + subnet.setCidr(""); + subnet.setName(""); + subnet.setNetworkId(network.getId()); + subnet.setIpVersion(4); + sub = quantum.subnets().create(subnet).execute(); + RouterForCreate routerForCreate = new RouterForCreate(); + routerForCreate.setName("routerName"); + routerForCreate.setTenantId("tenantId"); + Router router = quantum.routers().create(routerForCreate) + .execute(); + RouterForAddInterface routerForAdd = new RouterForAddInterface(); + routerForAdd.setSubnetId(sub.getId()); + routerForAdd.setRouterId(router.getId()); + quantum.routers().addInterface(routerForAdd).execute(); + + // System.out.println(sub); + } catch (Exception e) { + System.out.println(e.getMessage()); + } + + Networks networks = quantum.networks().list().execute(); + + for (Network network1 : networks) { + System.out.println(network1); + } + } else { + System.out.println("No tenants found!"); + } + + } +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumQueryNetworks.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumQueryNetworks.java new file mode 100644 index 000000000..1a427ea23 --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/network/QuantumQueryNetworks.java @@ -0,0 +1,59 @@ +package com.woorea.openstack.examples.network; + +import com.woorea.openstack.keystone.utils.KeystoneUtils; + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Tenants; +import com.woorea.openstack.keystone.model.authentication.TokenAuthentication; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.quantum.Quantum; +import com.woorea.openstack.quantum.model.Network; + +public class QuantumQueryNetworks { + + /** + * @param args + */ + public static void main(String[] args) { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + // access with unscoped token + Access access = keystone.tokens().authenticate( + new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .execute(); + // use the token in the following requests + keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + Tenants tenants = keystone.tenants().list().execute(); + // try to exchange token using the first tenant + if (tenants.getList().size() > 0) { + // access with tenant + access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute(); + + Quantum quantumClient = new Quantum(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "network", null, "public")); + quantumClient.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + Network networkQuery = new Network(); + networkQuery.setName("benn.cs"); + networkQuery.setAdminStateUp(true); + /* + Networks networks = quantumClient.execute(NetworkQuery.queryNetworks(networkQuery)); + + for (Network network : networks) { + System.out.println(network); + } + + Subnet subnetQuery = new Subnet(); + subnetQuery.setIpversion(Subnet.IpVersion.IPV4); + Subnets Subnets = quantumClient.execute(NetworkQuery.querySubnets(subnetQuery)); + for (Subnet subnet : Subnets) { + System.out.println(subnet); + } + */ + } else { + System.out.println("No tenants found!"); + } + } +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/objectstore/SwiftExample.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/objectstore/SwiftExample.java new file mode 100644 index 000000000..089163c66 --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/objectstore/SwiftExample.java @@ -0,0 +1,90 @@ +package com.woorea.openstack.examples.objectstore; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import com.woorea.openstack.keystone.utils.KeystoneUtils; + +import com.woorea.openstack.base.client.OpenStackSimpleTokenProvider; +import com.woorea.openstack.examples.ExamplesConfiguration; +import com.woorea.openstack.keystone.Keystone; +import com.woorea.openstack.keystone.model.Access; +import com.woorea.openstack.keystone.model.Tenants; +import com.woorea.openstack.keystone.model.authentication.TokenAuthentication; +import com.woorea.openstack.keystone.model.authentication.UsernamePassword; +import com.woorea.openstack.swift.Swift; +import com.woorea.openstack.swift.model.ObjectDownload; +import com.woorea.openstack.swift.model.ObjectForUpload; + +public class SwiftExample { + + private static final File TEST_FILE = new File("pom.xml"); + + /** + * @param args + */ + public static void main(String[] args) throws Exception { + Keystone keystone = new Keystone(ExamplesConfiguration.KEYSTONE_AUTH_URL); + //access with unscoped token + Access access = keystone.tokens().authenticate( + new UsernamePassword(ExamplesConfiguration.KEYSTONE_USERNAME, ExamplesConfiguration.KEYSTONE_PASSWORD)) + .execute(); + + //use the token in the following requests + keystone.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + Tenants tenants = keystone.tenants().list().execute(); + + //try to exchange token using the first tenant + if(tenants.getList().size() > 0) { + + access = keystone.tokens().authenticate(new TokenAuthentication(access.getToken().getId())).withTenantId(tenants.getList().get(0).getId()).execute(); + + Swift swift = new Swift(KeystoneUtils.findEndpointURL(access.getServiceCatalog(), "object-store", null, "public")); + swift.setTokenProvider(new OpenStackSimpleTokenProvider(access.getToken().getId())); + + //swiftClient.execute(new DeleteContainer("navidad2")); + + swift.containers().create("navidad2").execute(); + + System.out.println(swift.containers().list()); + + ObjectForUpload upload = new ObjectForUpload(); + upload.setContainer("navidad2"); + upload.setName("example2"); + upload.setInputStream(new FileInputStream(TEST_FILE)); + swift.containers().container("navidad2").upload(upload).execute(); + +// System.out.println(swiftClient.execute(new ListObjects("navidad2", new HashMap() {{ +// put("path", ""); +// }})).get(0).getContentType()); + + + ObjectDownload download = swift.containers().container("navidad").download("example2").execute(); + write(download.getInputStream(), "example2"); + } + + } + + private static void write(InputStream is, String path) { + try { + OutputStream stream = new BufferedOutputStream(new FileOutputStream(path)); + int bufferSize = 1024; + byte[] buffer = new byte[bufferSize]; + int len = 0; + while ((len = is.read(buffer)) != -1) { + stream.write(buffer, 0, len); + } + stream.close(); + } catch(IOException e) { + throw new RuntimeException(e.getMessage(), e); + } + + } + +} diff --git a/openstack-examples/src/main/java/com/woorea/openstack/examples/simple/OpenStackSimpleClient.java b/openstack-examples/src/main/java/com/woorea/openstack/examples/simple/OpenStackSimpleClient.java new file mode 100644 index 000000000..c2e8023ae --- /dev/null +++ b/openstack-examples/src/main/java/com/woorea/openstack/examples/simple/OpenStackSimpleClient.java @@ -0,0 +1,15 @@ +package com.woorea.openstack.examples.simple; + + +public class OpenStackSimpleClient { + + /** + * @param args + */ + public static void main(String[] args) { +// OpenStackClient client = new OpenStackClient(ExamplesConfiguration.KEYSTONE_AUTH_URL); +// Access access = client.request("/tokens").execute("POST", Entity.json("{\"auth\":{\"passwordCredentials\":{\"username\":\"\",\"password\":\"\"}}}"), Access.class); +// System.out.println(access); + } + +} diff --git a/pom.xml b/pom.xml index 8bbfb3d38..f25f715d4 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,60 @@ - + 4.0.0 - jar - org.openstack + com.woorea openstack-java-sdk - 1.0-RC2 + 3.2.10-SNAPSHOT + pom OpenStack Java SDK - http://github.com/woorea/openstack-java-sdk + OpenStack Java SDK + + + org.sonatype.oss + oss-parent + 7 + + + + + nova-client + glance-client + cinder-client + keystone-client + swift-client + quantum-client + openstack-client + heat-client + nova-model + glance-model + cinder-model + keystone-model + swift-model + quantum-model + ceilometer-model + ceilometer-client + openstack-client-connectors + heat-model + + + + + console + + true + + + openstack-console + + + + examples + + true + + + openstack-examples + + + @@ -24,406 +72,44 @@ luis@woorea.es +1 - - justinsb - Justin Santa Barbara - - scm:http://github.com/woorea/openstack-java-sdk.git - scm:http://github.com/woorea/openstack-java-sdk.git + scm:git:https://github.com/woorea/openstack-java-sdk.git + scm:git:https://github.com/woorea/openstack-java-sdk.git http://github.com/woorea/openstack-java-sdk.git - - - releases - https://github.com/woorea/maven/raw/master/releases - - - snapshots - https://github.com/woorea/maven/raw/master/snapshots - - - - - - - javanet-snapshots - - https://maven.java.net/content/repositories/snapshots - - - - org.testng - testng - 6.5.2 - test - - - commons-codec - commons-codec - 1.6 - - - com.google.guava - guava - 12.0 - - - commons-io - commons-io - 2.1 - - - org.glassfish.jersey.core - jersey-client - 2.0-SNAPSHOT - - - org.glassfish.jersey.media - jersey-media-json - 2.0-SNAPSHOT + com.fasterxml.jackson.core + jackson-databind + 2.9.8 - org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.1 - 1.6 - 1.6 + 1.7 + 1.7 UTF-8 org.apache.maven.plugins - maven-source-plugin - 2.1.2 - - - - jar - - - + maven-eclipse-plugin + 2.9 + + + org.apache.maven.plugins + maven-resources-plugin + 2.6 - - - - UTF-8 - - true - - false - Low - etc/config/exclude-common.xml - etc/config/javadoc-stylesheet.css - - - - - integration-tests - - false - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - true - - - - surefire-it - integration-test - - test - - - ${skipTests} - - - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.12 - - ${skipTests} - - - - - integration-test - verify - - - - - - org.codehaus.mojo - findbugs-maven-plugin - 2.4.0 - - true - true - true - ${findbugs.exclude} - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.8 - - ${project.build.directory}/checkstyle - ${project.build.directory}/checkstyle/checkstyle-result.xml - etc/config/checkstyle.xml - - - - - checkstyle - - validate - - - - - - - - attach-all - - false - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8.1 - - OpenStack Java SDK ${project.version} Documentation - - Copyright © 2012 OpenStack Java SDK. - All Rights Reserved. - Use is subject to license terms. - - ${javadoc.stylesheet} - - http://jax-rs-spec.java.net/nonav/2.0-SNAPSHOT/apidocs - - - - - attach-javadocs - - jar - - - - - - - - - site - - false - - - - - com.agilejava.docbkx - docbkx-maven-plugin - 2.0.14 - - - genhtml - - generate-html - - pre-site - - true - 1 - 1 - - - - - - - - - - - - - - genpdf - - generate-pdf - - pre-site - - -Xmx1024m - ${basedir}/target/docbkx/pdf/ - ${basedir}/src/docbkx/styles/fop-cust.xsl - 1 - 1 - A4 - - - - - - - - - - - - screen.css - true - 1 - - - - org.docbook - docbook-xml - 4.4 - runtime - - - - - org.apache.maven.plugins - maven-site-plugin - 3.0 - - false - true - - - org.codehaus.mojo - findbugs-maven-plugin - 2.4.0 - - - - ${findbugs.skip} - ${findbugs.threshold} - - - - findbugs - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.8.1 - - OpenStack Java SDK ${project.version} Documentation - - Copyright © 2012 OpenStack Java SDK. - All Rights - Reserved. - Use is subject to license terms. - - ${javadoc.stylesheet} - - http://jax-rs-spec.java.net/nonav/2.0-SNAPSHOT/apidocs - - - - - - aggregate - - - - - - - - - - org.apache.maven.plugins - maven-jxr-plugin - 2.3 - - - - jxr - aggregate - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.8 - - - etc/config/checkstyle.xml - - - - - checkstyle - - - - - - - - - - - - diff --git a/quantum-client/pom.xml b/quantum-client/pom.xml new file mode 100644 index 000000000..ae3968959 --- /dev/null +++ b/quantum-client/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + quantum-client + OpenStack Quantum Client + OpenStack Quantum Client + + + com.woorea + openstack-client + 3.2.10-SNAPSHOT + + + com.woorea + quantum-model + 3.2.10-SNAPSHOT + + + diff --git a/quantum-client/src/main/java/com/woorea/openstack/quantum/Quantum.java b/quantum-client/src/main/java/com/woorea/openstack/quantum/Quantum.java new file mode 100644 index 000000000..ec9c40f97 --- /dev/null +++ b/quantum-client/src/main/java/com/woorea/openstack/quantum/Quantum.java @@ -0,0 +1,51 @@ +package com.woorea.openstack.quantum; + + +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackClientConnector; +import com.woorea.openstack.quantum.api.NetworksResource; +import com.woorea.openstack.quantum.api.PortsResource; +import com.woorea.openstack.quantum.api.RoutersResource; +import com.woorea.openstack.quantum.api.SubnetsResource; + + +public class Quantum extends OpenStackClient { + + private final NetworksResource NETWORKS; + + private final PortsResource PORTS; + + private final SubnetsResource SUBNETS; + private final RoutersResource ROUTERS; + + public Quantum(String endpoint, OpenStackClientConnector connector) { + super(endpoint, connector); + NETWORKS = new NetworksResource(this); + PORTS = new PortsResource(this); + SUBNETS = new SubnetsResource(this); + ROUTERS=new RoutersResource(this); + + } + + public Quantum(String endpoint) { + this(endpoint, null); + } + + public NetworksResource networks() { + return NETWORKS; + } + + public PortsResource ports() { + return PORTS; + } + + public SubnetsResource subnets() { + return SUBNETS; + } + public RoutersResource routers() + { + return ROUTERS; + } + + +} diff --git a/quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java new file mode 100644 index 000000000..8b8edeec9 --- /dev/null +++ b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/NetworksResource.java @@ -0,0 +1,84 @@ +package com.woorea.openstack.quantum.api; + + +import com.woorea.openstack.base.client.Entity; +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.quantum.model.Network; +import com.woorea.openstack.quantum.model.Networks; + +public class NetworksResource { + + private final OpenStackClient CLIENT; + + public NetworksResource(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Create create(Network net) { + return new Create(net); + } + + public Update update(Network net) { + return new Update(net); + } + + public Delete delete(String netId){ + return new Delete(netId); + } + + public Show show(String netId){ + return new Show(netId); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, buildPath("networks"), null, Networks.class); + } + } + + public class Query extends OpenStackRequest { + + public Query(Network network) { + //super(network); +// target = target.path("v2.0").path("networks"); +// target = queryParam(target); +// return target.request(MediaType.APPLICATION_JSON).get(Networks.class); + } + } + + + public class Create extends OpenStackRequest { + + public Create(Network net) { + super(CLIENT, HttpMethod.POST, buildPath("networks"), Entity.json(net), Network.class); + } + } + + public class Update extends OpenStackRequest { + + public Update(Network net) { + super(CLIENT, HttpMethod.PUT, buildPath("networks", net.getId()), Entity.json(net), Network.class); + } + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, buildPath("networks", id), null, Network.class); + } + } + + public class Delete extends OpenStackRequest { + + public Delete(String id){ + super(CLIENT, HttpMethod.DELETE, buildPath("networks", id), null, Void.class); + } + } +} diff --git a/quantum-client/src/main/java/com/woorea/openstack/quantum/api/PortsResource.java b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/PortsResource.java new file mode 100644 index 000000000..b1cac3cc9 --- /dev/null +++ b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/PortsResource.java @@ -0,0 +1,85 @@ +package com.woorea.openstack.quantum.api; + + +import com.woorea.openstack.base.client.Entity; +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.quantum.model.Port; +import com.woorea.openstack.quantum.model.Ports; + +public class PortsResource { + + private final OpenStackClient CLIENT; + + public PortsResource(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Create create(Port port){ + return new Create(port); + } + + public Update update(Port port){ + return new Update(port); + } + + public Delete delete(String portId){ + return new Delete(portId); + } + + public Show show(String portId){ + return new Show(portId); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, buildPath("ports"), null, Ports.class); + } + } + + public class Query extends OpenStackRequest { + + public Query(Port port) { + //super(port); +// target = target.path("v2.0").path("ports"); +// target = queryParam(target); +// return target.request(MediaType.APPLICATION_JSON).get(Ports.class); + } + + } + + + public class Create extends OpenStackRequest { + + public Create(Port port){ + super(CLIENT, HttpMethod.POST, buildPath("ports"), Entity.json(port), Port.class); + } + } + + public class Update extends OpenStackRequest { + + public Update(Port port){ + super(CLIENT, HttpMethod.PUT, buildPath("ports", port.getId()), Entity.json(port), Port.class); + } + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, buildPath("ports", id), null, Port.class); + } + } + + public class Delete extends OpenStackRequest { + + public Delete(String id){ + super(CLIENT, HttpMethod.DELETE, buildPath("ports", id), null, Void.class); + } + } +} diff --git a/quantum-client/src/main/java/com/woorea/openstack/quantum/api/RoutersResource.java b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/RoutersResource.java new file mode 100644 index 000000000..71357097e --- /dev/null +++ b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/RoutersResource.java @@ -0,0 +1,102 @@ +package com.woorea.openstack.quantum.api; + +import com.woorea.openstack.base.client.Entity; +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.quantum.model.Router; +import com.woorea.openstack.quantum.model.RouterForAddInterface; +import com.woorea.openstack.quantum.model.RouterForCreate; +import com.woorea.openstack.quantum.model.RouterInterface; +import com.woorea.openstack.quantum.model.Routers; + +public class RoutersResource { + + private final OpenStackClient CLIENT; + + public RoutersResource(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Create create(RouterForCreate router){ + return new Create(router); + } + + public Delete delete(String netId){ + return new Delete(netId); + } + + public Show show(String netId){ + return new Show(netId); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, buildPath("routers"), null, Routers.class); + } + } + + public class Query extends OpenStackRequest { + + public Query(Router router) { + //super(network); +// target = target.path("v2.0").path("networks"); +// target = queryParam(target); +// return target.request(MediaType.APPLICATION_JSON).get(Networks.class); + } + } + public class Create extends OpenStackRequest { + + public Create(RouterForCreate router){ + super(CLIENT, HttpMethod.POST, buildPath("routers"), Entity.json(router), Router.class); + } + } + + + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, buildPath("routers", id), null, Router.class); + } + } + + public class Delete extends OpenStackRequest { + + public Delete(String id){ + super(CLIENT, HttpMethod.DELETE, buildPath("routers", id), null, Void.class); + } + } + public Attach addInterface(RouterForAddInterface interfaceToAdd){ + return new Attach(interfaceToAdd); + } + public class Attach extends OpenStackRequest { + + public Attach(RouterForAddInterface interfaceToAdd){ + super(CLIENT, HttpMethod.PUT, buildPath("routers",interfaceToAdd.getRouterId(),"add_router_interface"), Entity.json(interfaceToAdd),RouterInterface.class); + } + + } + public Detach deleteInterface(RouterForAddInterface interfaceRouter) { + return new Detach(interfaceRouter); + } + + public class Detach extends OpenStackRequest { + + public Detach(RouterForAddInterface interfaceToAdd) { + super(CLIENT, HttpMethod.PUT, buildPath("routers", + interfaceToAdd.getRouterId(), "remove_router_interface"), + Entity.json(interfaceToAdd), RouterInterface.class); + } + + } + + + + +} diff --git a/quantum-client/src/main/java/com/woorea/openstack/quantum/api/SubnetsResource.java b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/SubnetsResource.java new file mode 100644 index 000000000..3f6f5e5c8 --- /dev/null +++ b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/SubnetsResource.java @@ -0,0 +1,84 @@ +package com.woorea.openstack.quantum.api; + + +import com.woorea.openstack.base.client.Entity; +import com.woorea.openstack.base.client.HttpMethod; +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.quantum.model.Subnet; +import com.woorea.openstack.quantum.model.Subnets; + +public class SubnetsResource { + + private final OpenStackClient CLIENT; + + public SubnetsResource(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Create create(Subnet net) { + return new Create(net); + } + + public Update update(Subnet net) { + return new Update(net); + } + + public Delete delete(String netId){ + return new Delete(netId); + } + + public Show show(String netId){ + return new Show(netId); + } + + public class List extends OpenStackRequest { + + public List() { + super(CLIENT, HttpMethod.GET, buildPath("subnets"), null, Subnets.class); + } + } + + public class Query extends OpenStackRequest { + + public Query(Subnet subnet) { + //super(subnet); +// target = target.path("v2.0").path("subnets"); +// target = queryParam(target); +// return target.request(MediaType.APPLICATION_JSON).get(Subnets.class); + } + } + + + public class Create extends OpenStackRequest { + + public Create(Subnet subnet) { + super(CLIENT, HttpMethod.POST, buildPath("subnets"), Entity.json(subnet), Subnet.class); + } + } + + public class Update extends OpenStackRequest { + + public Update(Subnet subnet) { + super(CLIENT, HttpMethod.PUT, buildPath("subnets", subnet.getId()), Entity.json(subnet), Subnet.class); + } + } + + public class Show extends OpenStackRequest { + + public Show(String id) { + super(CLIENT, HttpMethod.GET, buildPath("subnets", id), null, Subnet.class); + } + } + + public class Delete extends OpenStackRequest { + + public Delete(String id){ + super(CLIENT, HttpMethod.DELETE, buildPath("subnets", id), null, Void.class); + } + } +} diff --git a/quantum-client/src/main/java/com/woorea/openstack/quantum/api/query/AbsOpenStackCmd.java b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/query/AbsOpenStackCmd.java new file mode 100644 index 000000000..342d9c3f8 --- /dev/null +++ b/quantum-client/src/main/java/com/woorea/openstack/quantum/api/query/AbsOpenStackCmd.java @@ -0,0 +1,80 @@ +package com.woorea.openstack.quantum.api.query; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import com.woorea.openstack.base.client.OpenStackRequest; + +public class AbsOpenStackCmd extends OpenStackRequest { + + private T query; + + protected AbsOpenStackCmd(T query) + { + this.setQuery(query); + } + + /** + * @param query the query to set + */ + public void setQuery(T query) { + this.query = query; + } + + /** + * @return the query + */ + public T getQuery() { + return query; + } + + private String getFieldValue(Field field, T target) + { + try { + field.setAccessible(true); + Object obj = field.get(target); + if (obj == null) + return null; + return obj.toString(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private Map getObjectParamMap(T target) + { + Map resultMap = new HashMap(); + if (target == null) + return resultMap; + + Field[] paramMap = target.getClass().getDeclaredFields(); + for (Field field : paramMap) { + String resultName = field.getName(); + String value = getFieldValue(field, target); + if (value != null) { + JsonProperty prop = field.getAnnotation(JsonProperty.class); + if (prop != null) { + resultMap.put(prop.value(), getFieldValue(field, target)); + } else { + resultMap.put(resultName, getFieldValue(field, target)); + } + } + } + + return resultMap; + } + + /* + public WebTarget queryParam(WebTarget target) { + Map map = getObjectParamMap(this.query); + for (String fieldName : map.keySet()) { + target = target.queryParam(fieldName, map.get(fieldName)); + } + return target; + } + */ + +} diff --git a/quantum-model/pom.xml b/quantum-model/pom.xml new file mode 100644 index 000000000..a441743df --- /dev/null +++ b/quantum-model/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + quantum-model + OpenStack Quantum Model + OpenStack Quantum Model + + + junit + junit + 4.11 + test + + + diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/GatewayInfo.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/GatewayInfo.java new file mode 100644 index 000000000..eddfc3326 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/GatewayInfo.java @@ -0,0 +1,24 @@ +package com.woorea.openstack.quantum.model; + +import java.util.List; +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GatewayInfo implements Serializable { + + @JsonProperty("network_id") + private String networkId; + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String id) { + this.networkId = id; + } + + @Override public String toString() { + return "[networkId=" + networkId + "]"; + } +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/HostRoute.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/HostRoute.java new file mode 100644 index 000000000..979add34b --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/HostRoute.java @@ -0,0 +1,27 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; + +public class HostRoute implements Serializable { + + private String destination; + private String nexthop; + + public String getDestination() { + return destination; + } + public void setDestination(String destination) { + this.destination = destination; + } + + public String getNexthop() { + return nexthop; + } + public void setNexthop(String nexthop) { + this.nexthop = nexthop; + } + + @Override public String toString() { + return "[destination=" + destination + ", nexthop=" + nexthop + "]"; + } +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Network.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Network.java new file mode 100644 index 000000000..c79766857 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Network.java @@ -0,0 +1,316 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@SuppressWarnings("serial") +@JsonRootName("network") +@JsonIgnoreProperties(ignoreUnknown = true) +public class Network implements Serializable { + + private String status; + + private List subnets; + + private String name; + + @JsonProperty("admin_state_up") + private Boolean adminStateUp; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("provider:physical_network") + private String providerPhysicalNetwork; + + @JsonProperty("provider:network_type") + private String providerNetworkType; + + @JsonProperty("provider:segmentation_id") + private Integer providerSegmentationId; + + @JsonProperty("router:external") + private String routerExternal; + + private String id; + + private String shared; + + private Integer mtu; + + @JsonProperty("port_security_enabled") + private Boolean portSecurityEnabled; + + /** + * @return the status + */ + @JsonIgnore + public String getStatus() { + return status; + } + + /** + * @param status + * the status to set + */ + @JsonProperty + public void setStatus(String status) { + this.status = status; + } + + /** + * @return the subnets + */ + @JsonIgnore + public List getSubnets() { + return subnets; + } + + /** + * @param subnets + * the subnets to set + */ + @JsonProperty + public void setSubnets(List subnets) { + this.subnets = subnets; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the providerPhyNet + * @deprecated + */ + @Deprecated + @JsonIgnore + public String getProviderPhyNet() { + return getProviderPhysicalNetwork(); + } + + /** + * @param providerPhyNet + * the providerPhyNet to set + * @deprecated + */ + @Deprecated + @JsonIgnore + public void setProviderPhyNet(String providerPhyNet) { + setProviderPhysicalNetwork(providerPhyNet); + } + + /** + * @return the adminStateUp + */ + @JsonIgnore + public boolean isAdminStateUp() { + return adminStateUp; + } + + public Boolean getAdminStateUp() { + return adminStateUp; + } + + /** + * @param adminStateUp + * the adminStateUp to set + */ + public void setAdminStateUp(Boolean adminStateUp) { + this.adminStateUp = adminStateUp; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @param tenantId + * the tenantId to set + */ + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * @return the netType + * @deprecated + */ + @Deprecated + @JsonIgnore + public String getNetType() { + return getProviderNetworkType(); + } + + /** + * @param netType + * the netType to set + * @deprecated + */ + @Deprecated + @JsonIgnore + public void setNetType(String netType) { + setProviderNetworkType(netType); + } + + /** + * @return the routerExternal + */ + public String getRouterExternal() { + return routerExternal; + } + + /** + * @param routerExternal + * the routerExternal to set + */ + public void setRouterExternal(String routerExternal) { + this.routerExternal = routerExternal; + } + + /** + * @return the id + */ + @JsonIgnore + public String getId() { + return id; + } + + /** + * @param id + * the id to set + */ + @JsonProperty + public void setId(String id) { + this.id = id; + } + + /** + * @return the shared + */ + public String getShared() { + return shared; + } + + /** + * @param shared + * the shared to set + */ + public void setShared(String shared) { + this.shared = shared; + } + + /** + * @return the providerSegID + * @deprecated + */ + @Deprecated + @JsonIgnore + public String getProviderSegID() { + return getProviderSegmentationId() == null ? null : Integer.toString(getProviderSegmentationId()); + } + + /** + * @param providerSegID + * the providerSegID to set + * @deprecated + */ + @Deprecated + @JsonIgnore + public void setProviderSegID(String providerSegID) { + setProviderSegmentationId(providerSegID == null ? null : Integer.parseInt(providerSegID)); + } + + public String getProviderNetworkType() { + return providerNetworkType; + } + + public void setProviderNetworkType(String providerNetworkType) { + this.providerNetworkType = providerNetworkType; + } + + public String getProviderPhysicalNetwork() { + return providerPhysicalNetwork; + } + + public void setProviderPhysicalNetwork(String providerPhysicalNetwork) { + this.providerPhysicalNetwork = providerPhysicalNetwork; + } + + public Integer getProviderSegmentationId() { + return providerSegmentationId; + } + + public void setProviderSegmentationId(Integer providerSegmentationId) { + this.providerSegmentationId = providerSegmentationId; + } + + /** + * @return the MTU + */ + public Integer getMtu() { + return mtu; + } + + /** + * @param mtu + * the MTU to set + */ + public void setMtu(Integer mtu) { + this.mtu = mtu; + } + + /** + * @return the portSecurityEnabled + */ + @JsonIgnore + public boolean isPortSecurityEnabled() { + return portSecurityEnabled; + } + + public Boolean getPortSecurityEnabled() { + return portSecurityEnabled; + } + + /** + * + * @param portSecurityEnabled enable / disable the default portSecurityEnabled for all future ports in this network + */ + public void setPortSecurityEnabled(Boolean portSecurityEnabled) { + this.portSecurityEnabled = portSecurityEnabled; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Network [id=" + id + ", name=" + name + ", subnets=" + + subnets + ", status=" + status + ", admin_state_up=" + adminStateUp + ", tenant_id=" + + tenantId + ", shared=" + shared + ", mtu=" + mtu + ", provider:physical_network=" + + providerPhysicalNetwork + ", provider:network_type=" + providerNetworkType + ", router:external=" + + routerExternal + ", provider:segmentation_id=" + providerSegmentationId + + ", port_security_enabled=" + portSecurityEnabled + "]"; + } +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/NetworkForCreate.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/NetworkForCreate.java new file mode 100644 index 000000000..1d4d5cb69 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/NetworkForCreate.java @@ -0,0 +1,9 @@ +package com.woorea.openstack.quantum.model; + +import com.fasterxml.jackson.annotation.JsonRootName; + +@SuppressWarnings("serial") +@JsonRootName("network") +@Deprecated +public class NetworkForCreate extends Network { +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Networks.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Networks.java new file mode 100644 index 000000000..f5b251ceb --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Networks.java @@ -0,0 +1,38 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Networks implements Iterable, Serializable{ + + @JsonProperty("networks") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + + /** + * @param list the list to set + */ + public void setList(List list) { + this.list = list; + } + + + public String toString() { + return "Networks [list=" + list + "]"; + } + + + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Pool.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Pool.java new file mode 100644 index 000000000..d25bafe8e --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Pool.java @@ -0,0 +1,40 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; + +public class Pool implements Serializable{ + + private String start; + private String end; + + /** + * @return the start + */ + public String getStart() { + return start; + } + /** + * @param start the start to set + */ + public void setStart(String start) { + this.start = start; + } + /** + * @return the end + */ + public String getEnd() { + return end; + } + /** + * @param end the end to set + */ + public void setEnd(String end) { + this.end = end; + } + + @Override + public String toString() { + return "Allocation_pool [start=" + start + ", end=" + end + "]"; + } + +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Port.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Port.java new file mode 100644 index 000000000..169809899 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Port.java @@ -0,0 +1,374 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonRootName; + +@SuppressWarnings("serial") +@JsonRootName("port") +@JsonIgnoreProperties(ignoreUnknown = true) +public class Port implements Serializable { + + public static final class Ip implements Serializable { + + @JsonProperty("ip_address") + private String address; + + @JsonProperty("subnet_id") + private String subnetId; + + /** + * @return the address + */ + public String getAddress() { + return address; + } + + /** + * @param address + * the address to set + */ + public void setAddress(String address) { + this.address = address; + } + + /** + * @return the subnetId + */ + public String getSubnetId() { + return subnetId; + } + + /** + * @param subnetId + * the subnetId to set + */ + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + @Override + public String toString() { + return "ip_addresses [ip_address=" + address + ", subnet_id=" + subnetId + "]"; + } + + } + + public static final class Binding { + + /** + * The host on which the port will be allocated. + */ + @JsonProperty("binding:host_id") + private String hostId; + + /** + * The vif type for the specific port. + */ + @JsonProperty("binding:vif_type") + private String vifType; + + /** + * The type of vnic that this port should be attached to + */ + @JsonProperty("binding:vnic_type") + private String vnicType; + + /** + * A map containing additional information needed by the interface driver + */ + @JsonProperty("binding:vif_details") + private Map vifDetails; + + /** + * A map to enable applications running on the specific host to pass and receive vif port specific information + * to the plugin. + */ + @JsonProperty("binding:profile") + private Map profile; + + public String getHostId() { + return hostId; + } + + public void setHostId(String hostId) { + this.hostId = hostId; + } + + public String getVifType() { + return vifType; + } + + public void setVifType(String vifType) { + this.vifType = vifType; + } + + public String getVnicType() { + return vnicType; + } + + public void setVnicType(String vnicType) { + this.vnicType = vnicType; + } + + public Map getVifDetails() { + return vifDetails; + } + + public void setVifDetails(Map vifDetails) { + this.vifDetails = vifDetails; + } + + public Map getProfile() { + return profile; + } + + public void setProfile(Map profile) { + this.profile = profile; + } + + @Override + public String toString() { + return "Binding [hostId=" + hostId + + ", vifType=" + vifType + + ", vnicType=" + vnicType + + ", vifDetails=" + vifDetails + + ", profile=" + profile + "]"; + } + } + + @JsonProperty("admin_state_up") + private Boolean adminStateUp; + + @JsonProperty("device_id") + private String deviceId; + + @JsonProperty("device_owner") + private String deviceOwner; + + @JsonProperty("fixed_ips") + private List list; + + private String id; + + @JsonProperty("mac_address") + private String macAddress; + + private String name; + + @JsonProperty("network_id") + private String networkId; + + private String status; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("security_groups") + private List securityGroups; + + @JsonUnwrapped + private Binding binding; + + /** + * @return the adminStateUp + */ + public Boolean getAdminStateUp() { + return adminStateUp; + } + + /** + * @param adminStateUp + * the adminStateUp to set + */ + public void setAdminStateUp(Boolean adminStateUp) { + this.adminStateUp = adminStateUp; + } + + /** + * @return the deviceId + */ + public String getDeviceId() { + return deviceId; + } + + /** + * @param deviceId + * the deviceId to set + */ + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + /** + * @return the deviceOwner + */ + public String getDeviceOwner() { + return deviceOwner; + } + + /** + * @param deviceOwner + * the deviceOwner to set + */ + public void setDeviceOwner(String deviceOwner) { + this.deviceOwner = deviceOwner; + } + + /** + * @return the list + */ + public List getList() { + return list; + } + + /** + * @param list + * the list to set + */ + public void setList(List list) { + this.list = list; + } + + /** + * @return the id + */ + @JsonIgnore + public String getId() { + return id; + } + + /** + * @param id + * the id to set + */ + @JsonProperty + public void setId(String id) { + this.id = id; + } + + /** + * @return the macAddress + */ + public String getMacAddress() { + return macAddress; + } + + /** + * @param macAddress + * the macAddress to set + */ + public void setMacAddress(String macAddress) { + this.macAddress = macAddress; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the networkId + */ + public String getNetworkId() { + return networkId; + } + + /** + * @param networkId + * the networkId to set + */ + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + /** + * @return the status + */ + @JsonIgnore + public String getStatus() { + return status; + } + + /** + * @param status + * the status to set + */ + @JsonProperty + public void setStatus(String status) { + this.status = status; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @param tenantId + * the tenantId to set + */ + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * @return the associated security group IDs + */ + public List getSecurityGroups() { + return securityGroups; + } + + /** + * @param securityGroups + * IDs of security groups to associate to the port + */ + public void setSecurityGroups(List securityGroups) { + this.securityGroups = securityGroups; + } + + /** + * @return the binding of the port + */ + public Binding getBinding() { + return binding; + } + + /** + * @param binding + * The port bindings by which the port is bind to network on host + */ + public void setBinding(Binding binding) { + this.binding = binding; + } + + @Override + public String toString() { + return "Port [id=" + id + ", name=" + name + ", mac_address=" + + macAddress + ", admin_state_up=" + adminStateUp + ", device_id=" + deviceId + + ", device_owner=" + deviceOwner + ", fixed_ips=" + list + + ", network_id=" + networkId + ", status=" + status + + ", tenant_id=" + tenantId + + ", securityGroups=" + securityGroups + + ", binding=" + binding + "]"; + } +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/PortForCreate.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/PortForCreate.java new file mode 100644 index 000000000..f7df76f53 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/PortForCreate.java @@ -0,0 +1,12 @@ +package com.woorea.openstack.quantum.model; + +import com.fasterxml.jackson.annotation.JsonRootName; + +/** + * @deprecated Please use {@link Port} directly. + */ +@SuppressWarnings("serial") +@JsonRootName("port") +@Deprecated +public class PortForCreate extends Port { +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Ports.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Ports.java new file mode 100644 index 000000000..5d0ed3a2e --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Ports.java @@ -0,0 +1,40 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +@SuppressWarnings("serial") +public class Ports implements Iterable, Serializable { + + @JsonProperty("ports") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /** + * @param list + * the list to set + */ + public void setList(List list) { + this.list = list; + } + + @Override + public Iterator iterator() { + return list.iterator(); + } + + @Override + public String toString() { + return "Ports [list=" + list + "]"; + } + +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Router.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Router.java new file mode 100644 index 000000000..c1acb433e --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Router.java @@ -0,0 +1,77 @@ +package com.woorea.openstack.quantum.model; + +import java.util.List; +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("router") +public class Router implements Serializable { + + @JsonProperty("status") + private String status; + + @JsonProperty("external_gateway_info") + private GatewayInfo externalGatewayInfo; + + @JsonProperty("name") + private String name; + + @JsonProperty("admin_state_up") + private String admin_state_up; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("id") + private String id; + + @JsonProperty("routes") + private List routes; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public List getRoutes() { + return routes; + } + public void setRoutes(List routes) { + this.routes = routes; + } + public String getAdmin_state_up() { + return admin_state_up; + } + public void setAdmin_state_up(String admin_state_up) { + this.admin_state_up = admin_state_up; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + public GatewayInfo getExternalGatewayInfo() { + return externalGatewayInfo; + } + public void setExternalGatewayInfo(GatewayInfo externalGatewayInfo) { + this.externalGatewayInfo = externalGatewayInfo; + } + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterForAddInterface.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterForAddInterface.java new file mode 100644 index 000000000..24ca72d51 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterForAddInterface.java @@ -0,0 +1,28 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class RouterForAddInterface implements Serializable { + + @JsonProperty("subnet_id") + String subnetId; + String routerId; + + public String getSubnetId() { + return subnetId; + } + + public void setSubnetId(String subnetId) { + this.subnetId = subnetId; + } + + public String getRouterId() { + return routerId; + } + + public void setRouterId(String routerId) { + this.routerId = routerId; + } + } diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterForCreate.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterForCreate.java new file mode 100644 index 000000000..26ca202ec --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterForCreate.java @@ -0,0 +1,75 @@ +package com.woorea.openstack.quantum.model; + +import java.util.List; +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +@JsonRootName("router") +public class RouterForCreate implements Serializable { + + @JsonProperty("name") + private String name; + + private List routes; + + @JsonProperty("admin_state_up") + private String admin_state_up; + + @JsonProperty("status") + private String status; + + @JsonProperty("external_gateway_info") + private GatewayInfo externalGatewayInfo; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("id") + private String id; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public List getRoutes() { + return routes; + } + public void setRoutes(List routes) { + this.routes = routes; + } + public String getAdmin_state_up() { + return admin_state_up; + } + public void setAdmin_state_up(String admin_state_up) { + this.admin_state_up = admin_state_up; + } + public String getStatus() { + return status; + } + public void setStatus(String status) { + this.status = status; + } + public GatewayInfo getExternalGatewayInfo() { + return externalGatewayInfo; + } + public void setExternalGatewayInfo(GatewayInfo externalGatewayInfo) { + this.externalGatewayInfo = externalGatewayInfo; + } + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterInterface.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterInterface.java new file mode 100644 index 000000000..824779e03 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/RouterInterface.java @@ -0,0 +1,19 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonRootName; + +public class RouterInterface implements Serializable { + + @JsonProperty("subnet_id") + String subnetId; + @JsonProperty("port_id") + String portId; + @JsonProperty("tenant_id") + String tenantId; + @JsonProperty("id") + String id; + +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Routers.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Routers.java new file mode 100644 index 000000000..f180cdb6b --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Routers.java @@ -0,0 +1,38 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Routers implements Iterable, Serializable{ + + @JsonProperty("routers") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + + /** + * @param list the list to set + */ + public void setList(List list) { + this.list = list; + } + + + public String toString() { + return "Routers [list=" + list + "]"; + } + + + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Subnet.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Subnet.java new file mode 100644 index 000000000..b300f71e8 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Subnet.java @@ -0,0 +1,265 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonRootName; + +@SuppressWarnings("serial") +@JsonRootName("subnet") +@JsonIgnoreProperties(ignoreUnknown = true) +public class Subnet implements Serializable { + + private String name; + + @JsonProperty("enable_dhcp") + private Boolean enableDHCP; + + @JsonProperty("network_id") + private String networkId; + + @JsonProperty("tenant_id") + private String tenantId; + + @JsonProperty("dns_nameservers") + private List dnsNames; + + @JsonProperty("allocation_pools") + private List list; + + @JsonProperty("host_routes") + private List hostRoutes; + + @JsonProperty("ip_version") + private IpVersion ipversion; + + @JsonProperty("gateway_ip") + private String gw; + + private String cidr; + + private String id; + + public static enum IpVersion implements Serializable { + IPV4(4), + IPV6(6); + private int code; + + IpVersion(int code) { + this.code = code; + } + + @JsonValue + public int code() { + return code; + } + + @JsonCreator + public static IpVersion valueOf(int value) { + for (IpVersion ipVersion : IpVersion.values()) { + if (ipVersion.code() == value) { + return ipVersion; + } + } + return IPV4; + } + + @Override + public String toString() { + return String.valueOf(code); + } + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name + * the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the enableDHCP + */ + @JsonIgnore + public boolean isEnableDHCP() { + return enableDHCP; + } + + public Boolean getEnableDHCP() { + return enableDHCP; + } + + /** + * @param enableDHCP + * the enableDHCP to set + */ + public void setEnableDHCP(Boolean enableDHCP) { + this.enableDHCP = enableDHCP; + } + + /** + * @return the networkId + */ + public String getNetworkId() { + return networkId; + } + + /** + * @param networkId + * the networkId to set + */ + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + /** + * @return the tenantId + */ + public String getTenantId() { + return tenantId; + } + + /** + * @param tenantId + * the tenantId to set + */ + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + /** + * @return the dnsNames + */ + public List getDnsNames() { + return dnsNames; + } + + /** + * @param dnsNames + * the dnsNames to set + */ + public void setDnsNames(List dnsNames) { + this.dnsNames = dnsNames; + } + + /** + * @return the list + */ + public List getList() { + return list; + } + + /** + * @param list + * the list to set + */ + public void setList(List list) { + this.list = list; + } + + /** + * @return the hostRoutes + */ + public List getHostRoutes() { + return hostRoutes; + } + + /** + * @param hostRoutes + * the hostRoutes to set + */ + public void setHostRoutes(List hostRoutes) { + this.hostRoutes = hostRoutes; + } + + /** + * @return the ipversion + */ + public IpVersion getIpversion() { + return ipversion; + } + + /** + * @param ipversion + * the ipversion to set + */ + public void setIpversion(IpVersion ipversion) { + this.ipversion = ipversion; + } + + /** + * @return the gw + */ + public String getGw() { + return gw; + } + + /** + * @param gw + * the gw to set + */ + public void setGw(String gw) { + this.gw = gw; + } + + /** + * @return the cidr + */ + public String getCidr() { + return cidr; + } + + /** + * @param cidr + * the cidr to set + */ + public void setCidr(String cidr) { + this.cidr = cidr; + } + + /** + * @return the id + */ + @JsonIgnore + public String getId() { + return id; + } + + /** + * @param id + * the id to set + */ + @JsonProperty + public void setId(String id) { + this.id = id; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Subnet [id=" + id + ", name=" + name + ", network_id=" + + networkId + ", tenant_id=" + tenantId + ", allocation_pools=" + list + + ", gateway_ip=" + gw + ", ip_version=" + ipversion + + ", cidr=" + cidr + ", enable_dhcp=" + enableDHCP + ", dns_nameservers=" + + dnsNames + ", host_routes=" + hostRoutes + "]"; + } + +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/SubnetForCreate.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/SubnetForCreate.java new file mode 100644 index 000000000..fe0b19e2a --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/SubnetForCreate.java @@ -0,0 +1,34 @@ +package com.woorea.openstack.quantum.model; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonRootName; + +/** + * Please use {@link Subnet} directly. + */ +@SuppressWarnings("serial") +@JsonRootName("subnet") +@Deprecated +public class SubnetForCreate extends Subnet { + + /** + * @return the ipVersion + * @deprecated + */ + @Deprecated + @JsonIgnore + public int getIpVersion() { + return getIpversion().code(); + } + + /** + * @param ipVersion + * the ipVersion to set + * @deprecated + */ + @Deprecated + @JsonIgnore + public void setIpVersion(int ipVersion) { + setIpversion(IpVersion.valueOf(ipVersion)); + } +} diff --git a/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Subnets.java b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Subnets.java new file mode 100644 index 000000000..b520e5a91 --- /dev/null +++ b/quantum-model/src/main/java/com/woorea/openstack/quantum/model/Subnets.java @@ -0,0 +1,36 @@ +package com.woorea.openstack.quantum.model; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Subnets implements Serializable, Iterable { + + @JsonProperty("subnets") + private List list; + + /** + * @return the list + */ + public List getList() { + return list; + } + + /** + * @param list the list to set + */ + public void setList(List list) { + this.list = list; + } + + public String toString() { + return "Subnets [list=" + list + "]"; + } + + public Iterator iterator() { + return list.iterator(); + } + +} diff --git a/quantum-model/src/test/java/com/woorea/openstack/quantum/model/NetworkTest.java b/quantum-model/src/test/java/com/woorea/openstack/quantum/model/NetworkTest.java new file mode 100644 index 000000000..a54326873 --- /dev/null +++ b/quantum-model/src/test/java/com/woorea/openstack/quantum/model/NetworkTest.java @@ -0,0 +1,124 @@ +package com.woorea.openstack.quantum.model; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertThat; + +import java.util.Arrays; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Before; +import org.junit.Test; + +public class NetworkTest { + + private static final String ID = "testId"; + + private static final boolean ADMIN_STATE_UP = true; + + private static final String NAME = "name"; + + private static final String TENANT_ID = "tenantId"; + + private static final String SHARED = "shared"; + + private static final String STATUS = "status"; + + private static final String SUBNET = "subnet"; + + private static final String PROVIDER_NETWORK_TYPE = "vlan"; + + private static final String PROVIDER_PHYSICAL_NETWORK = "physicalNetwork"; + + private static final int PROVIDER_SEGMENTATION_ID = 100; + + private static final String ROUTER_EXTERNAL = "routerExternal"; + + private static final Boolean PORT_SECURITY_ENABLED = Boolean.FALSE; + + /** + * JSON with read only attributes. + */ + private static final String NETWORK_JSON = "{" + + " \"network\" : {" + + " \"id\" : \"" + ID + "\"," + + " \"status\" : \"" + STATUS + "\"," + + " \"subnets\" : [ \"" + SUBNET + "\" ]" + + " }" + + "}"; + + private ObjectMapper objectMapper; + + private String serializedNetwork; + + @Before + public void setUp() throws Exception { + objectMapper = PortTest.initializeObjectMapper(); + } + + @Test + public void testSerialization() throws Exception { + Network network = new Network(); + network.setId(ID); + network.setProviderNetworkType(PROVIDER_NETWORK_TYPE); + network.setProviderPhysicalNetwork(PROVIDER_PHYSICAL_NETWORK); + network.setProviderSegmentationId(PROVIDER_SEGMENTATION_ID); + network.setAdminStateUp(ADMIN_STATE_UP); + network.setSubnets(Arrays.asList(SUBNET)); + network.setRouterExternal(ROUTER_EXTERNAL); + network.setName(NAME); + network.setShared(SHARED); + network.setTenantId(TENANT_ID); + network.setPortSecurityEnabled(PORT_SECURITY_ENABLED); + + serializedNetwork = objectMapper.writeValueAsString(network); + assertThat(serializedNetwork, not(containsString(ID))); + assertThat(serializedNetwork, not(containsString(STATUS))); + assertThat(serializedNetwork, not(containsString(SUBNET))); + assertThat(serializedNetwork, containsString("\"admin_state_up\" : " + ADMIN_STATE_UP)); + assertThat(serializedNetwork, containsString(NAME)); + assertThat(serializedNetwork, containsString(SHARED)); + assertThat(serializedNetwork, containsString(TENANT_ID)); + assertThat(serializedNetwork, containsString(ROUTER_EXTERNAL)); + assertThat(serializedNetwork, containsString(PROVIDER_NETWORK_TYPE)); + assertThat(serializedNetwork, containsString(PROVIDER_PHYSICAL_NETWORK)); + assertThat(serializedNetwork, containsString(Integer.toString(PROVIDER_SEGMENTATION_ID))); + assertThat(serializedNetwork, containsString("\"port_security_enabled\" : " + PORT_SECURITY_ENABLED)); + } + + @Test + public void testSerializationEmpty() throws Exception { + Network network = new Network(); + serializedNetwork = objectMapper.writeValueAsString(network); + + assertThat(serializedNetwork, containsString("\"network\" : { }")); + } + + @Test + public void testDeserializationReadOnlyFields() throws Exception { + Network network = objectMapper.readValue(NETWORK_JSON, Network.class); + + assertThat(network.getId(), is(equalTo(ID))); + assertThat(network.getSubnets(), hasItem(equalTo(SUBNET))); + assertThat(network.getStatus(), is(equalTo(STATUS))); + } + + @Test + public void testDeserialization() throws Exception { + testSerialization(); + Network network = objectMapper.readValue(serializedNetwork, Network.class); + + assertThat(network.getName(), is(equalTo(NAME))); + assertThat(network.isAdminStateUp(), is(equalTo(ADMIN_STATE_UP))); + assertThat(network.getShared(), is(equalTo(SHARED))); + assertThat(network.getTenantId(), is(equalTo(TENANT_ID))); + assertThat(network.getRouterExternal(), is(equalTo(ROUTER_EXTERNAL))); + assertThat(network.getProviderNetworkType(), is(equalTo(PROVIDER_NETWORK_TYPE))); + assertThat(network.getProviderPhysicalNetwork(), is(equalTo(PROVIDER_PHYSICAL_NETWORK))); + assertThat(network.getProviderSegmentationId(), is(equalTo(PROVIDER_SEGMENTATION_ID))); + assertThat(network.getPortSecurityEnabled(), is(equalTo(PORT_SECURITY_ENABLED))); + } +} diff --git a/quantum-model/src/test/java/com/woorea/openstack/quantum/model/PortTest.java b/quantum-model/src/test/java/com/woorea/openstack/quantum/model/PortTest.java new file mode 100644 index 000000000..e63efbd3b --- /dev/null +++ b/quantum-model/src/test/java/com/woorea/openstack/quantum/model/PortTest.java @@ -0,0 +1,156 @@ +package com.woorea.openstack.quantum.model; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertThat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion; +import org.hamcrest.CustomMatcher; +import org.junit.Before; +import org.junit.Test; + +import com.woorea.openstack.quantum.model.Port.Ip; + +public class PortTest { + + private static final String TENANT_ID = "tenantId"; + + private static final String STATUS = "status"; + + private static final String NETWORK_ID = "networkId"; + + private static final String NAME = "name"; + + private static final String MAC_ADDRESS = "macAddress"; + + private static final String DEVICE_OWNER = "deviceOwner"; + + private static final String DEVICE_ID = "deviceId"; + + private static final String IP_SUBNET_ID = "ipSubnetId"; + + private static final String IP_ADDRESS = "10.0.0.1"; + + private static final boolean ADMIN_STATE_UP = true; + + private static final String SEC_GROUP = "secGroup"; + + private static final String ID = "testId"; + + /** + * JSON with read only attributes. + */ + private static final String PORT_JSON = "{" + + " \"port\" : {" + + " \"id\" : \"" + ID + "\"," + + " \"status\" : \"" + STATUS + "\"" + + " }" + + "}"; + + private ObjectMapper objectMapper; + + private String serializedPort; + + @Before + public void setUp() throws Exception { + objectMapper = initializeObjectMapper(); + } + + public static ObjectMapper initializeObjectMapper() { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL) + .enable(SerializationFeature.INDENT_OUTPUT) + .enable(SerializationFeature.WRAP_ROOT_VALUE) + .enable(DeserializationFeature.UNWRAP_ROOT_VALUE) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); + return objectMapper; + } + + @Test + public void testSerialization() throws Exception { + Port port = new Port(); + port.setId(ID); + port.setAdminStateUp(ADMIN_STATE_UP); + port.setSecurityGroups(Arrays.asList(SEC_GROUP)); + port.setDeviceId(DEVICE_ID); + port.setDeviceOwner(DEVICE_OWNER); + port.setMacAddress(MAC_ADDRESS); + port.setName(NAME); + port.setNetworkId(NETWORK_ID); + port.setStatus(STATUS); + port.setTenantId(TENANT_ID); + + List ips = new ArrayList(); + Ip ip = new Ip(); + ip.setAddress(IP_ADDRESS); + ip.setSubnetId(IP_SUBNET_ID); + ips.add(ip); + port.setList(ips); + + serializedPort = objectMapper.writeValueAsString(port); + assertThat(serializedPort, not(containsString(ID))); + assertThat(serializedPort, not(containsString(STATUS))); + assertThat(serializedPort, containsString("\"admin_state_up\" : " + ADMIN_STATE_UP)); + assertThat(serializedPort, containsString(SEC_GROUP)); + assertThat(serializedPort, containsString(IP_ADDRESS)); + assertThat(serializedPort, containsString(DEVICE_ID)); + assertThat(serializedPort, containsString(DEVICE_OWNER)); + assertThat(serializedPort, containsString(MAC_ADDRESS)); + assertThat(serializedPort, containsString(NAME)); + assertThat(serializedPort, containsString(NETWORK_ID)); + assertThat(serializedPort, containsString(TENANT_ID)); + } + + @Test + public void testSerializationEmpty() throws Exception { + Port port = new Port(); + serializedPort = objectMapper.writeValueAsString(port); + + assertThat(serializedPort, containsString("\"port\" : { }")); + } + + @Test + public void testDeserializationReadOnlyFields() throws Exception { + Port port = objectMapper.readValue(PORT_JSON, Port.class); + + assertThat(port.getId(), is(equalTo(ID))); + assertThat(port.getStatus(), is(equalTo(STATUS))); + } + + @Test + public void testDeserializationAfterSerialization() throws Exception { + testSerialization(); + Port port = objectMapper.readValue(serializedPort, Port.class); + + assertThat(port.getAdminStateUp(), is(equalTo(ADMIN_STATE_UP))); + assertThat(port.getDeviceId(), is(equalTo(DEVICE_ID))); + assertThat(port.getDeviceOwner(), is(equalTo(DEVICE_OWNER))); + assertThat(port.getMacAddress(), is(equalTo(MAC_ADDRESS))); + assertThat(port.getName(), is(equalTo(NAME))); + assertThat(port.getNetworkId(), is(equalTo(NETWORK_ID))); + assertThat(port.getTenantId(), is(equalTo(TENANT_ID))); + + assertThat(port.getSecurityGroups(), hasItem(equalTo(SEC_GROUP))); + assertThat(port.getList(), hasItem(new CustomMatcher( + "an Ip object with address " + IP_ADDRESS + " and subnet id " + IP_SUBNET_ID) { + + @Override + public boolean matches(Object ip) { + return ip instanceof Ip + && IP_ADDRESS.equals(((Ip) ip).getAddress()) + && IP_SUBNET_ID.equals(((Ip) ip).getSubnetId()); + } + })); + } +} diff --git a/quantum-model/src/test/java/com/woorea/openstack/quantum/model/SubnetTest.java b/quantum-model/src/test/java/com/woorea/openstack/quantum/model/SubnetTest.java new file mode 100644 index 000000000..013ca3028 --- /dev/null +++ b/quantum-model/src/test/java/com/woorea/openstack/quantum/model/SubnetTest.java @@ -0,0 +1,137 @@ +package com.woorea.openstack.quantum.model; + +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.hasItem; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.junit.Assert.assertThat; + +import java.util.Arrays; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.hamcrest.CustomMatcher; +import org.junit.Before; +import org.junit.Test; + +import com.woorea.openstack.quantum.model.Subnet.IpVersion; + +public class SubnetTest { + + private static final String POOL_END = "poolEnd"; + + private static final String POOL_START = "poolStart"; + + private static final String TENANT_ID = "tenantId"; + + private static final String NETWORK_ID = "networkId"; + + private static final String NAME = "name"; + + private static final String HOST_ROUTE = "hostRoute"; + + private static final String GATEWAY = "gw"; + + private static final boolean ENABLE_DHCP = true; + + private static final String ID = "testId"; + + private static final String CIDR = "10.0.0.0/8"; + + private static final String DNS_SERVER = "dnsServer"; + + private static final IpVersion IP_VERSION = IpVersion.IPV4; + + /** + * JSON with read only attributes. + */ + private static final String SUBNET_JSON = "{" + + " \"subnet\" : {" + + " \"id\" : \"" + ID + "\"" + + " }" + + "}"; + + private ObjectMapper objectMapper; + + private String serializedSubnet; + + @Before + public void setUp() throws Exception { + objectMapper = PortTest.initializeObjectMapper(); + } + + @Test + public void testSerialization() throws Exception { + Subnet subnet = new Subnet(); + subnet.setId(ID); + subnet.setCidr(CIDR); + subnet.setDnsNames(Arrays.asList(DNS_SERVER)); + subnet.setEnableDHCP(ENABLE_DHCP); + subnet.setIpversion(IP_VERSION); + subnet.setGw(GATEWAY); + subnet.setHostRoutes(Arrays.asList(HOST_ROUTE)); + subnet.setName(NAME); + subnet.setNetworkId(NETWORK_ID); + subnet.setTenantId(TENANT_ID); + + Pool pool = new Pool(); + pool.setStart(POOL_START); + pool.setEnd(POOL_END); + subnet.setList(Arrays.asList(pool)); + + serializedSubnet = objectMapper.writeValueAsString(subnet); + assertThat(serializedSubnet, not(containsString(ID))); + assertThat(serializedSubnet, containsString(CIDR)); + assertThat(serializedSubnet, containsString(DNS_SERVER)); + assertThat(serializedSubnet, containsString("\"enable_dhcp\" : " + ENABLE_DHCP)); + assertThat(serializedSubnet, containsString(Integer.toString(IP_VERSION.code()))); + assertThat(serializedSubnet, containsString(GATEWAY)); + assertThat(serializedSubnet, containsString(HOST_ROUTE)); + assertThat(serializedSubnet, containsString(NAME)); + assertThat(serializedSubnet, containsString(NETWORK_ID)); + assertThat(serializedSubnet, containsString(TENANT_ID)); + assertThat(serializedSubnet, containsString(POOL_START)); + assertThat(serializedSubnet, containsString(POOL_END)); + } + + @Test + public void testSerializationEmpty() throws Exception { + Subnet subnet = new Subnet(); + serializedSubnet = objectMapper.writeValueAsString(subnet); + + assertThat(serializedSubnet, containsString("\"subnet\" : { }")); + } + + @Test + public void testDeserializationReadOnlyFields() throws Exception { + Subnet subnet = objectMapper.readValue(SUBNET_JSON, Subnet.class); + + assertThat(subnet.getId(), is(equalTo(ID))); + } + + @Test + public void testDeserializationAfterSerialization() throws Exception { + testSerialization(); + Subnet subnet = objectMapper.readValue(serializedSubnet, Subnet.class); + + assertThat(subnet.getCidr(), is(equalTo(CIDR))); + assertThat(subnet.getDnsNames(), hasItem(equalTo(DNS_SERVER))); + assertThat(subnet.isEnableDHCP(), is(equalTo(ENABLE_DHCP))); + assertThat(subnet.getIpversion(), is(equalTo(IP_VERSION))); + assertThat(subnet.getGw(), is(equalTo(GATEWAY))); + assertThat(subnet.getHostRoutes(), hasItem(equalTo(HOST_ROUTE))); + assertThat(subnet.getName(), is(equalTo(NAME))); + assertThat(subnet.getNetworkId(), is(equalTo(NETWORK_ID))); + assertThat(subnet.getTenantId(), is(equalTo(TENANT_ID))); + assertThat(subnet.getList(), hasItem(new CustomMatcher( + "a Pool object with start " + POOL_START + " and end " + POOL_END) { + + @Override + public boolean matches(Object pool) { + return pool instanceof Pool + && POOL_START.equals(((Pool) pool).getStart()) + && POOL_END.equals(((Pool) pool).getEnd()); + } + })); + } +} diff --git a/src/docbkx/compute-api.xml b/src/docbkx/compute-api.xml deleted file mode 100644 index a9b6b61f9..000000000 --- a/src/docbkx/compute-api.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - - Compute API - - - - -
- Core - - - -
- Servers - - - NovaServerForCreate sfc = new NovaServerForCreate(); - sfc.setName(random.randomAlphanumericString(10)); - sfc.setFlavorRef(findSmallestFlavor().getId()); - sfc.setImageRef(image.getId()); - Server server = compute.servers().post(serverForCreate); - - - POST - http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers - - - - 202 - - - - - - Server server = - compute.servers().server("af7b93fe-3262-446a-8f19-b5b637d67b74").get(); - - - GET - http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 - - - 200 - - - - - - compute.servers().server("af7b93fe-3262-446a-8f19-b5b637d67b74").action().post(new - PauseAction(), String.class); - - - POST - http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74/action - {"pause":{}} - - - 202 - - - - - compute.servers().server("af7b93fe-3262-446a-8f19-b5b637d67b74").action().post(new - UnpauseAction(), String.class); - - - POST - http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74/action - {"unpause":{}} - - - 202 - - - - - compute.servers().server("af7b93fe-3262-446a-8f19-b5b637d67b74").delete(); - - - DELETE - http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 - - - - - - - compute.servers().server("af7b93fe-3262-446a-8f19-b5b637d67b74").delete(); - - - DELETE - http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 - - - - - -
-
- Images - - - ImageList images = compute.images().get(); - - - GET - http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/detail - - - - - -
-
- Flavors - - - FlavorList flavors = compute.flavors().get(); - - - GET - http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/detail - - - - - -
-
-
- Extensions - - - -
- Key Pairs - - KeyPairList flavors = compute.keypairs().get(); - - - POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs - -
-
- Security Groups - - SecurityGroupList flavors = compute.securitygroups().get(); - - - POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups - -
-
- Volumes - - VolumeList flavors = compute.volumes().get(); - - - POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-volumes - -
-
- Snapshots - - SnapshotList flavors = compute.snaphots().get(); - - - POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-snaphots - -
-
- Floating IPs - - FloatingIpList flavors = compute.floatingips().get(); - - - POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-floating-ips - -
-
-
\ No newline at end of file diff --git a/src/docbkx/compute_congig_drive.txt b/src/docbkx/compute_congig_drive.txt deleted file mode 100644 index e1ff22691..000000000 --- a/src/docbkx/compute_congig_drive.txt +++ /dev/null @@ -1,114 +0,0 @@ -Apr 2, 2012 5:11:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"demo","password":"secret0"},"tenantName":"demo"}} - -Apr 2, 2012 5:11:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2470 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:17:41 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T18:17:41Z", "id": "151724e41a0e41b9af45c9a8ae7f3bfb", "tenant": {"enabled": true, "id": "49ca8fb0aef0469996ca10eec7ff51a2", "name": "demo", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "76e2570dadf2413ba0349ea9583b6b76", "roles": [{"id": "fd9f96340215451cb5d7089ec091a9de", "name": "anotherrole"}, {"id": "31d8e7c333124a32a7ba5d117cd3d09a", "name": "Member"}], "name": "demo"}}} - -Apr 2, 2012 5:11:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/detail -1 > Accept: application/json -1 > X-Auth-Token: 151724e41a0e41b9af45c9a8ae7f3bfb - -Apr 2, 2012 5:11:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2199 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:17:41 GMT -2 < X-Compute-Request-Id: req-6665f492-ba92-42ae-b536-c7cc8633a8e0 -{"images": [{"status": "ACTIVE", "updated": "2012-03-20T17:32:23Z", "name": "cirros-0.3.0-x86_64-uec", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:22Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "metadata": {"kernel_id": "c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "ramdisk_id": "8b1c8692-1817-4ecf-8a88-72b82266de93"}}, {"status": "ACTIVE", "updated": "2012-03-20T17:32:22Z", "name": "cirros-0.3.0-x86_64-uec-ramdisk", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:22Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "8b1c8692-1817-4ecf-8a88-72b82266de93", "metadata": {}}, {"status": "ACTIVE", "updated": "2012-03-20T17:32:21Z", "name": "cirros-0.3.0-x86_64-uec-kernel", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:21Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "metadata": {}}]} - -Apr 2, 2012 5:11:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 3 * LoggingFilter - Request received on thread main -3 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/detail -3 > X-Auth-Token: 151724e41a0e41b9af45c9a8ae7f3bfb - -Apr 2, 2012 5:11:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 4 * LoggingFilter - Response received on thread main -4 < 200 -4 < Connection: keep-alive -4 < Content-Length: 1738 -4 < Content-Type: application/json -4 < Date: Tue, 20 Mar 2012 18:17:41 GMT -4 < X-Compute-Request-Id: req-8aa215b9-228a-4bfc-8eb9-ded9da7e1e91 -{"flavors": [{"vcpus": 1, "disk": 0, "name": "m1.tiny", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "ram": 512, "id": "1", "swap": ""}, {"vcpus": 1, "disk": 10, "name": "m1.small", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/2", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/2", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 20, "ram": 2048, "id": "2", "swap": ""}, {"vcpus": 2, "disk": 10, "name": "m1.medium", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/3", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/3", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 40, "ram": 4096, "id": "3", "swap": ""}, {"vcpus": 4, "disk": 10, "name": "m1.large", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/4", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/4", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 80, "ram": 8192, "id": "4", "swap": ""}, {"vcpus": 8, "disk": 10, "name": "m1.xlarge", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/5", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/5", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 160, "ram": 16384, "id": "5", "swap": ""}]} - -Apr 2, 2012 5:11:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 5 * LoggingFilter - Request received on thread main -5 > POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs -5 > Accept: application/json -5 > Content-Type: application/json -5 > X-Auth-Token: 151724e41a0e41b9af45c9a8ae7f3bfb -{"keypair":{"name":"J7KZI"}} - -Apr 2, 2012 5:11:16 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 6 * LoggingFilter - Response received on thread main -6 < 200 -6 < Connection: keep-alive -6 < Content-Length: 1309 -6 < Content-Type: application/json -6 < Date: Tue, 20 Mar 2012 18:17:42 GMT -6 < X-Compute-Request-Id: req-d69c31d1-4899-450a-b112-4a81c152f704 -{"keypair": {"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC2hMrkowTrqVi+TJtYFdgiE+8LPdJBc/Jipkq4eu7ezFYCUXb3sYPqJtvvsUUHA1M19qgXhN+BeAlgFdco3PXymVEcAd5PYGfY1akUs5SXPPlo7jM6zU0ZVSt7lfFOdNBZAXZk6njaZ0C1db2jisOYw5tfOTO7g+7HTLk7U7+eWQ== stack@ubuntu\n", "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIICWwIBAAKBgQC2hMrkowTrqVi+TJtYFdgiE+8LPdJBc/Jipkq4eu7ezFYCUXb3\nsYPqJtvvsUUHA1M19qgXhN+BeAlgFdco3PXymVEcAd5PYGfY1akUs5SXPPlo7jM6\nzU0ZVSt7lfFOdNBZAXZk6njaZ0C1db2jisOYw5tfOTO7g+7HTLk7U7+eWQIDAQAB\nAoGAYOLq5SWYRhTWM+Zsi/zEh4p3WUtO4knPQAiwH2+6f3COs5pVAbUspk5Mb9d1\nIfzk3f96SUnSb2Kt72CIn3tz3pX9nE+GVZgQZkPBbBm5EFAmdvyiPjXuaslChxyz\nd9+Ju7iQY0iqYprC9hC5Wf5l1RIE9MWLVihWey7uCPElqAECQQDyb3xfpw0WA30U\nTrYxV+eHzZu4XXVXfJehViSZgb/naKuHQJ/wrBstJVsIEhAVqLNW19b3y5uJopwE\noc0SPtMBAkEAwLsXaq7I2vICjXgv/mBREQnAi5sSkfit+XdHYG9+Zmv5IwYjVdgd\nNeahOm+tvo90J38ke7dDEtG3oy7ATa9DWQJABC8OW2w7mpSm1PHizQkyUrKmrFDY\nlJDu4PbmnMuTbz/sLeJcoD+oHGhXoNUG+Ai4R5hj+lTGM2LeBGpyao0xAQJAA9Qz\ntOTgDKl+L31RxsX3FlWRQ7TC+69rFWevPVU5t6MxgeafURdIDUgVr+mEFCMZdadq\n/CI57OfJtC47l8+BkQJAEYws5bctJnU22lwycIeb9y2S1qJVY9tL7lOQzhOLVodm\nJdMApHA69EcNc/QaqxqoiWHF/xUEHc6hubeGOWJDsw==\n-----END RSA PRIVATE KEY-----\n", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "name": "J7KZI", "fingerprint": "c6:cf:0e:ee:7f:08:6f:cc:aa:4c:17:41:1e:20:59:2a"}} - -Apr 2, 2012 5:11:16 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 7 * LoggingFilter - Request received on thread main -7 > POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers -7 > Accept: application/json -7 > Content-Type: application/json -7 > X-Auth-Token: 151724e41a0e41b9af45c9a8ae7f3bfb -{"server":{"name":"VB2da65vth","imageRef":"d00e8cef-a05f-4d53-bace-0289b43c15bf","flavorRef":"1","keyName":"J7KZI","configDrive":true}} - -Apr 2, 2012 5:11:16 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 8 * LoggingFilter - Response received on thread main -8 < 202 -8 < Connection: keep-alive -8 < Content-Length: 398 -8 < Content-Type: application/json -8 < Date: Tue, 20 Mar 2012 18:17:42 GMT -8 < Location: http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/adeff845-256a-4753-8ff0-1a9f331622a2 -8 < X-Compute-Request-Id: req-f4477953-201e-4f4d-8561-1b6da0c304c8 -{"server": {"OS-DCF:diskConfig": "MANUAL", "id": "adeff845-256a-4753-8ff0-1a9f331622a2", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/adeff845-256a-4753-8ff0-1a9f331622a2", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/adeff845-256a-4753-8ff0-1a9f331622a2", "rel": "bookmark"}], "adminPass": "Fud9JYmSGvju"}} - -Deleting server: Server [id=adeff845-256a-4753-8ff0-1a9f331622a2, name=null, status=null, updated=null, created=null, hostId=null, userId=null, tenantId=null, accessIpV4=null, accessIpV6=null, adminPass=Fud9JYmSGvju, progress=null, configDrive=null, keyName=null, image=null, flavor=null, fault=null, metadata=null, addresses=null, links=[Link [rel=self, href=http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/adeff845-256a-4753-8ff0-1a9f331622a2, type=null], Link [rel=bookmark, href=http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/adeff845-256a-4753-8ff0-1a9f331622a2, type=null]]] -Apr 2, 2012 5:11:16 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 9 * LoggingFilter - Request received on thread main -9 > DELETE http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/adeff845-256a-4753-8ff0-1a9f331622a2 -9 > X-Auth-Token: 151724e41a0e41b9af45c9a8ae7f3bfb - -Apr 2, 2012 5:11:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 10 * LoggingFilter - Response received on thread main -10 < 204 -10 < Connection: keep-alive -10 < Content-Length: 0 -10 < Content-Type: application/json -10 < Date: Tue, 20 Mar 2012 18:17:43 GMT -10 < X-Compute-Request-Id: req-3e35904d-193c-47a5-be8a-78561dd73848 - -Apr 2, 2012 5:11:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 11 * LoggingFilter - Request received on thread main -11 > DELETE http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs/test -11 > X-Auth-Token: 151724e41a0e41b9af45c9a8ae7f3bfb - -Apr 2, 2012 5:11:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 12 * LoggingFilter - Response received on thread main -12 < 404 -12 < Connection: keep-alive -12 < Content-Length: 78 -12 < Content-Type: application/json; charset=UTF-8 -12 < Date: Tue, 20 Mar 2012 18:17:43 GMT -12 < X-Compute-Request-Id: req-04174999-99f7-4c22-b16f-c18262ec9fe2 -{"itemNotFound": {"message": "The resource could not be found.", "code": 404}} \ No newline at end of file diff --git a/src/docbkx/compute_extensions.txt b/src/docbkx/compute_extensions.txt deleted file mode 100644 index 7aec84d0d..000000000 --- a/src/docbkx/compute_extensions.txt +++ /dev/null @@ -1,592 +0,0 @@ -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"demo","password":"secret0"},"tenantName":"demo"}} - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2470 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:16:29 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T18:16:29Z", "id": "c92252cdf8ca441196859452a7b6c4ed", "tenant": {"enabled": true, "id": "49ca8fb0aef0469996ca10eec7ff51a2", "name": "demo", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "76e2570dadf2413ba0349ea9583b6b76", "roles": [{"id": "fd9f96340215451cb5d7089ec091a9de", "name": "anotherrole"}, {"id": "31d8e7c333124a32a7ba5d117cd3d09a", "name": "Member"}], "name": "demo"}}} - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions -1 > Accept: application/json -1 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 8609 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:16:29 GMT -2 < X-Compute-Request-Id: req-341a0854-0f38-4e09-9f54-59c5817cfec1 -{"extensions": [{"updated": "2011-09-27T00:00:00+00:00", "name": "DiskConfig", "links": [], "namespace": "http://docs.openstack.org/compute/ext/disk_config/api/v1.1", "alias": "OS-DCF", "description": "Disk Management Extension"}, {"updated": "2011-06-29T00:00:00+00:00", "name": "Hosts", "links": [], "namespace": "http://docs.openstack.org/compute/ext/hosts/api/v1.1", "alias": "os-hosts", "description": "Admin-only host administration"}, {"updated": "2011-07-19T00:00:00+00:00", "name": "SchedulerHints", "links": [], "namespace": "http://docs.openstack.org/compute/ext/scheduler-hints/api/v2", "alias": "os-scheduler-hints", "description": "Pass arbitrary key/value pairs to the scheduler"}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Quotas", "links": [], "namespace": "http://docs.openstack.org/compute/ext/quotas-sets/api/v1.1", "alias": "os-quota-sets", "description": "Quotas management support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Floating_ip_dns", "links": [], "namespace": "http://docs.openstack.org/ext/floating_ip_dns/api/v1.1", "alias": "os-floating-ip-dns", "description": "Floating IP DNS support"}, {"updated": "2011-09-14T00:00:00+00:00", "name": "FlavorExtraData", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1", "alias": "OS-FLV-EXT-DATA", "description": "Provide additional data for flavors"}, {"updated": "2011-06-23T00:00:00+00:00", "name": "FlavorExtraSpecs", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_specs/api/v1.1", "alias": "os-flavor-extra-specs", "description": "Instance type (flavor) extra specs"}, {"updated": "2011-07-21T00:00:00+00:00", "name": "SecurityGroups", "links": [], "namespace": "http://docs.openstack.org/compute/ext/securitygroups/api/v1.1", "alias": "security_groups", "description": "Security group support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Accounts", "links": [], "namespace": "http://docs.openstack.org/compute/ext/accounts/api/v1.1", "alias": "os-accounts", "description": "Admin-only access to accounts"}, {"updated": "2011-03-25T00:00:00+00:00", "name": "Volumes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/volumes/api/v1.1", "alias": "os-volumes", "description": "Volumes support"}, {"updated": "2011-11-03T00:00:00+00:00", "name": "ExtendedStatus", "links": [], "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", "alias": "OS-EXT-STS", "description": "Extended Status support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Consoles", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-consoles/api/v2", "alias": "os-consoles", "description": "Interactive Console support."}, {"updated": "2011-08-17T00:00:00+00:00", "name": "VirtualInterfaces", "links": [], "namespace": "http://docs.openstack.org/compute/ext/virtual_interfaces/api/v1.1", "alias": "virtual_interfaces", "description": "Virtual interface support"}, {"updated": "2012-01-12T00:00:00+00:00", "name": "Aggregates", "links": [], "namespace": "http://docs.openstack.org/compute/ext/aggregates/api/v1.1", "alias": "os-aggregates", "description": "Admin-only aggregate administration"}, {"updated": "2011-07-19T00:00:00+00:00", "name": "Createserverext", "links": [], "namespace": "http://docs.openstack.org/compute/ext/createserverext/api/v1.1", "alias": "os-create-server-ext", "description": "Extended support to the Create Server v1.1 API"}, {"updated": "2011-09-01T00:00:00+00:00", "name": "DeferredDelete", "links": [], "namespace": "http://docs.openstack.org/compute/ext/deferred-delete/api/v1.1", "alias": "os-deferred-delete", "description": "Instance deferred delete"}, {"updated": "2011-12-21T00:00:00+00:00", "name": "ServerDiagnostics", "links": [], "namespace": "http://docs.openstack.org/compute/ext/server-diagnostics/api/v1.1", "alias": "os-server-diagnostics", "description": "Allow Admins to view server diagnostics through server action"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Networks", "links": [], "namespace": "http://docs.openstack.org/compute/ext/networks/api/v1.1", "alias": "os-networks", "description": "Admin-only Network Management Extension"}, {"updated": "2011-11-03T00:00:00+00:00", "name": "ExtendedServerAttributes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", "alias": "OS-EXT-SRV-ATTR", "description": "Extended Server Attributes support."}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Keypairs", "links": [], "namespace": "http://docs.openstack.org/compute/ext/keypairs/api/v1.1", "alias": "os-keypairs", "description": "Keypair Support"}, {"updated": "2011-08-24T00:00:00+00:00", "name": "VolumeTypes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/volume_types/api/v1.1", "alias": "os-volume-types", "description": "Volume types support"}, {"updated": "2011-08-19T00:00:00+00:00", "name": "SimpleTenantUsage", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-simple-tenant-usage/api/v1.1", "alias": "os-simple-tenant-usage", "description": "Simple tenant usage extension"}, {"updated": "2012-01-04T00:00:00+00:00", "name": "Floating_ip_pools", "links": [], "namespace": "http://docs.openstack.org/compute/ext/floating_ip_pools/api/v1.1", "alias": "os-floating-ip-pools", "description": "Floating IPs support"}, {"updated": "2012-01-23T00:00:00+00:00", "name": "ServerStartStop", "links": [], "namespace": "http://docs.openstack.org/compute/ext/servers/api/v1.1", "alias": "os-server-start-stop", "description": "Start/Stop instance compute API support"}, {"updated": "2012-03-12T00:00:00+00:00", "name": "QuotaClasses", "links": [], "namespace": "http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1", "alias": "os-quota-class-sets", "description": "Quota classes management support"}, {"updated": "2012-01-19T00:00:00+00:00", "name": "Certificates", "links": [], "namespace": "http://docs.openstack.org/compute/ext/certificates/api/v1.1", "alias": "os-certificates", "description": "Certificates support"}, {"updated": "2011-12-08T00:00:00+00:00", "name": "Console_output", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-console-output/api/v2", "alias": "os-console-output", "description": "Console log output support, with tailing ability."}, {"updated": "2012-01-19T00:00:00+00:00", "name": "FlavorManage", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_manage/api/v1.1", "alias": "os-flavor-manage", "description": "\n Flavor create/delete API support\n "}, {"updated": "2011-12-16T00:00:00+00:00", "name": "Cloudpipe", "links": [], "namespace": "http://docs.openstack.org/compute/ext/cloudpipe/api/v1.1", "alias": "os-cloudpipe", "description": "Adds actions to create cloudpipe instances.\n\n When running with the Vlan network mode, you need a mechanism to route\n from the public Internet to your vlans. This mechanism is known as a\n cloudpipe.\n\n At the time of creating this class, only OpenVPN is supported. Support for\n a SSH Bastion host is forthcoming.\n "}, {"updated": "2011-06-09T00:00:00+00:00", "name": "Multinic", "links": [], "namespace": "http://docs.openstack.org/compute/ext/multinic/api/v1.1", "alias": "NMN", "description": "Multiple network support"}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Users", "links": [], "namespace": "http://docs.openstack.org/compute/ext/users/api/v1.1", "alias": "os-users", "description": "Allow admins to acces user information"}, {"updated": "2011-09-20T00:00:00+00:00", "name": "AdminActions", "links": [], "namespace": "http://docs.openstack.org/compute/ext/admin-actions/api/v1.1", "alias": "os-admin-actions", "description": "Enable admin-only server actions\n\n Actions include: pause, unpause, suspend, resume, migrate,\n resetNetwork, injectNetworkInfo, lock, unlock, createBackup\n "}, {"updated": "2011-12-21T00:00:00+00:00", "name": "ServerActionList", "links": [], "namespace": "http://docs.openstack.org/compute/ext/server-actions-list/api/v1.1", "alias": "os-server-action-list", "description": "Allow Admins to view pending server actions"}, {"updated": "2011-08-18T00:00:00+00:00", "name": "Rescue", "links": [], "namespace": "http://docs.openstack.org/compute/ext/rescue/api/v1.1", "alias": "os-rescue", "description": "Instance rescue mode"}, {"updated": "2011-06-16T00:00:00+00:00", "name": "Floating_ips", "links": [], "namespace": "http://docs.openstack.org/compute/ext/floating_ips/api/v1.1", "alias": "os-floating-ips", "description": "Floating IPs support"}]} - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 3 * LoggingFilter - Request received on thread main -3 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/OS-DCF -3 > Accept: application/json -3 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 4 * LoggingFilter - Response received on thread main -4 < 200 -4 < Connection: keep-alive -4 < Content-Length: 228 -4 < Content-Type: application/json -4 < Date: Tue, 20 Mar 2012 18:16:29 GMT -4 < X-Compute-Request-Id: req-f6575bf2-cd10-411b-8b6c-521b7e975cad -{"extension": {"updated": "2011-09-27T00:00:00+00:00", "name": "DiskConfig", "links": [], "namespace": "http://docs.openstack.org/compute/ext/disk_config/api/v1.1", "alias": "OS-DCF", "description": "Disk Management Extension"}} - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 5 * LoggingFilter - Request received on thread main -5 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-hosts -5 > Accept: application/json -5 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 6 * LoggingFilter - Response received on thread main -6 < 200 -6 < Connection: keep-alive -6 < Content-Length: 224 -6 < Content-Type: application/json -6 < Date: Tue, 20 Mar 2012 18:16:29 GMT -6 < X-Compute-Request-Id: req-ee7d579a-c2bc-4f7e-9535-c47af120036c -{"extension": {"updated": "2011-06-29T00:00:00+00:00", "name": "Hosts", "links": [], "namespace": "http://docs.openstack.org/compute/ext/hosts/api/v1.1", "alias": "os-hosts", "description": "Admin-only host administration"}} - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 7 * LoggingFilter - Request received on thread main -7 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-scheduler-hints -7 > Accept: application/json -7 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 8 * LoggingFilter - Response received on thread main -8 < 200 -8 < Connection: keep-alive -8 < Content-Length: 268 -8 < Content-Type: application/json -8 < Date: Tue, 20 Mar 2012 18:16:29 GMT -8 < X-Compute-Request-Id: req-16029927-d271-43fe-8870-50baee364c73 -{"extension": {"updated": "2011-07-19T00:00:00+00:00", "name": "SchedulerHints", "links": [], "namespace": "http://docs.openstack.org/compute/ext/scheduler-hints/api/v2", "alias": "os-scheduler-hints", "description": "Pass arbitrary key/value pairs to the scheduler"}} - -Apr 2, 2012 5:10:03 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 9 * LoggingFilter - Request received on thread main -9 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-quota-sets -9 > Accept: application/json -9 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 10 * LoggingFilter - Response received on thread main -10 < 200 -10 < Connection: keep-alive -10 < Content-Length: 231 -10 < Content-Type: application/json -10 < Date: Tue, 20 Mar 2012 18:16:29 GMT -10 < X-Compute-Request-Id: req-69120b4a-beb3-4086-b563-231c822d4298 -{"extension": {"updated": "2011-08-08T00:00:00+00:00", "name": "Quotas", "links": [], "namespace": "http://docs.openstack.org/compute/ext/quotas-sets/api/v1.1", "alias": "os-quota-sets", "description": "Quotas management support"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 11 * LoggingFilter - Request received on thread main -11 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-floating-ip-dns -11 > Accept: application/json -11 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 12 * LoggingFilter - Response received on thread main -12 < 200 -12 < Connection: keep-alive -12 < Content-Length: 239 -12 < Content-Type: application/json -12 < Date: Tue, 20 Mar 2012 18:16:30 GMT -12 < X-Compute-Request-Id: req-9dbfb00b-a899-4afd-bff2-cb405d6528b4 -{"extension": {"updated": "2011-12-23T00:00:00+00:00", "name": "Floating_ip_dns", "links": [], "namespace": "http://docs.openstack.org/ext/floating_ip_dns/api/v1.1", "alias": "os-floating-ip-dns", "description": "Floating IP DNS support"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 13 * LoggingFilter - Request received on thread main -13 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/OS-FLV-EXT-DATA -13 > Accept: application/json -13 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 14 * LoggingFilter - Response received on thread main -14 < 200 -14 < Connection: keep-alive -14 < Content-Length: 258 -14 < Content-Type: application/json -14 < Date: Tue, 20 Mar 2012 18:16:30 GMT -14 < X-Compute-Request-Id: req-b3a00fbf-4746-48ed-8885-a48e5003f7dd -{"extension": {"updated": "2011-09-14T00:00:00+00:00", "name": "FlavorExtraData", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1", "alias": "OS-FLV-EXT-DATA", "description": "Provide additional data for flavors"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 15 * LoggingFilter - Request received on thread main -15 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-flavor-extra-specs -15 > Accept: application/json -15 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 16 * LoggingFilter - Response received on thread main -16 < 200 -16 < Connection: keep-alive -16 < Content-Length: 265 -16 < Content-Type: application/json -16 < Date: Tue, 20 Mar 2012 18:16:30 GMT -16 < X-Compute-Request-Id: req-05904342-ed00-46f8-ad67-fcb9d7080bdb -{"extension": {"updated": "2011-06-23T00:00:00+00:00", "name": "FlavorExtraSpecs", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_specs/api/v1.1", "alias": "os-flavor-extra-specs", "description": "Instance type (flavor) extra specs"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 17 * LoggingFilter - Request received on thread main -17 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/security_groups -17 > Accept: application/json -17 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 18 * LoggingFilter - Response received on thread main -18 < 200 -18 < Connection: keep-alive -18 < Content-Length: 241 -18 < Content-Type: application/json -18 < Date: Tue, 20 Mar 2012 18:16:30 GMT -18 < X-Compute-Request-Id: req-bb8a8e89-94f6-48aa-ba35-ec6536d47b01 -{"extension": {"updated": "2011-07-21T00:00:00+00:00", "name": "SecurityGroups", "links": [], "namespace": "http://docs.openstack.org/compute/ext/securitygroups/api/v1.1", "alias": "security_groups", "description": "Security group support"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 19 * LoggingFilter - Request received on thread main -19 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-accounts -19 > Accept: application/json -19 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 20 * LoggingFilter - Response received on thread main -20 < 200 -20 < Connection: keep-alive -20 < Content-Length: 232 -20 < Content-Type: application/json -20 < Date: Tue, 20 Mar 2012 18:16:30 GMT -20 < X-Compute-Request-Id: req-60e3632a-a914-4782-9c1c-01fff881e142 -{"extension": {"updated": "2011-12-23T00:00:00+00:00", "name": "Accounts", "links": [], "namespace": "http://docs.openstack.org/compute/ext/accounts/api/v1.1", "alias": "os-accounts", "description": "Admin-only access to accounts"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 21 * LoggingFilter - Request received on thread main -21 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-volumes -21 > Accept: application/json -21 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 22 * LoggingFilter - Response received on thread main -22 < 200 -22 < Connection: keep-alive -22 < Content-Length: 215 -22 < Content-Type: application/json -22 < Date: Tue, 20 Mar 2012 18:16:30 GMT -22 < X-Compute-Request-Id: req-b746b189-2d90-4ee4-ab2b-76d031851098 -{"extension": {"updated": "2011-03-25T00:00:00+00:00", "name": "Volumes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/volumes/api/v1.1", "alias": "os-volumes", "description": "Volumes support"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 23 * LoggingFilter - Request received on thread main -23 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/OS-EXT-STS -23 > Accept: application/json -23 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 24 * LoggingFilter - Response received on thread main -24 < 200 -24 < Connection: keep-alive -24 < Content-Length: 238 -24 < Content-Type: application/json -24 < Date: Tue, 20 Mar 2012 18:16:30 GMT -24 < X-Compute-Request-Id: req-ad3dc7bb-21f9-468d-97d8-9e6a7308e84f -{"extension": {"updated": "2011-11-03T00:00:00+00:00", "name": "ExtendedStatus", "links": [], "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", "alias": "OS-EXT-STS", "description": "Extended Status support"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 25 * LoggingFilter - Request received on thread main -25 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-consoles -25 > Accept: application/json -25 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 26 * LoggingFilter - Response received on thread main -26 < 200 -26 < Connection: keep-alive -26 < Content-Length: 232 -26 < Content-Type: application/json -26 < Date: Tue, 20 Mar 2012 18:16:30 GMT -26 < X-Compute-Request-Id: req-f61ea32a-d8e4-41bc-ab69-1777ddc9052e -{"extension": {"updated": "2011-12-23T00:00:00+00:00", "name": "Consoles", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-consoles/api/v2", "alias": "os-consoles", "description": "Interactive Console support."}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 27 * LoggingFilter - Request received on thread main -27 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/virtual_interfaces -27 > Accept: application/json -27 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 28 * LoggingFilter - Response received on thread main -28 < 200 -28 < Connection: keep-alive -28 < Content-Length: 254 -28 < Content-Type: application/json -28 < Date: Tue, 20 Mar 2012 18:16:30 GMT -28 < X-Compute-Request-Id: req-b43c7610-8bdc-4503-91d2-fd6321731a3b -{"extension": {"updated": "2011-08-17T00:00:00+00:00", "name": "VirtualInterfaces", "links": [], "namespace": "http://docs.openstack.org/compute/ext/virtual_interfaces/api/v1.1", "alias": "virtual_interfaces", "description": "Virtual interface support"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 29 * LoggingFilter - Request received on thread main -29 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-aggregates -29 > Accept: application/json -29 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 30 * LoggingFilter - Response received on thread main -30 < 200 -30 < Connection: keep-alive -30 < Content-Length: 244 -30 < Content-Type: application/json -30 < Date: Tue, 20 Mar 2012 18:16:30 GMT -30 < X-Compute-Request-Id: req-52d3c424-3ee8-493e-84dc-877eb8a7af30 -{"extension": {"updated": "2012-01-12T00:00:00+00:00", "name": "Aggregates", "links": [], "namespace": "http://docs.openstack.org/compute/ext/aggregates/api/v1.1", "alias": "os-aggregates", "description": "Admin-only aggregate administration"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 31 * LoggingFilter - Request received on thread main -31 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-create-server-ext -31 > Accept: application/json -31 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 32 * LoggingFilter - Response received on thread main -32 < 200 -32 < Connection: keep-alive -32 < Content-Length: 272 -32 < Content-Type: application/json -32 < Date: Tue, 20 Mar 2012 18:16:30 GMT -32 < X-Compute-Request-Id: req-57c9dd0e-c20e-4783-8537-832136740e47 -{"extension": {"updated": "2011-07-19T00:00:00+00:00", "name": "Createserverext", "links": [], "namespace": "http://docs.openstack.org/compute/ext/createserverext/api/v1.1", "alias": "os-create-server-ext", "description": "Extended support to the Create Server v1.1 API"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 33 * LoggingFilter - Request received on thread main -33 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-deferred-delete -33 > Accept: application/json -33 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 34 * LoggingFilter - Response received on thread main -34 < 200 -34 < Connection: keep-alive -34 < Content-Length: 247 -34 < Content-Type: application/json -34 < Date: Tue, 20 Mar 2012 18:16:30 GMT -34 < X-Compute-Request-Id: req-ebeb5b94-dc3d-4f41-b71e-fcbc7a41b1ad -{"extension": {"updated": "2011-09-01T00:00:00+00:00", "name": "DeferredDelete", "links": [], "namespace": "http://docs.openstack.org/compute/ext/deferred-delete/api/v1.1", "alias": "os-deferred-delete", "description": "Instance deferred delete"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 35 * LoggingFilter - Request received on thread main -35 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-server-diagnostics -35 > Accept: application/json -35 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 36 * LoggingFilter - Response received on thread main -36 < 200 -36 < Connection: keep-alive -36 < Content-Length: 293 -36 < Content-Type: application/json -36 < Date: Tue, 20 Mar 2012 18:16:30 GMT -36 < X-Compute-Request-Id: req-d1402283-39ae-4d79-971d-4146fb308951 -{"extension": {"updated": "2011-12-21T00:00:00+00:00", "name": "ServerDiagnostics", "links": [], "namespace": "http://docs.openstack.org/compute/ext/server-diagnostics/api/v1.1", "alias": "os-server-diagnostics", "description": "Allow Admins to view server diagnostics through server action"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 37 * LoggingFilter - Request received on thread main -37 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-networks -37 > Accept: application/json -37 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 38 * LoggingFilter - Response received on thread main -38 < 200 -38 < Connection: keep-alive -38 < Content-Length: 242 -38 < Content-Type: application/json -38 < Date: Tue, 20 Mar 2012 18:16:30 GMT -38 < X-Compute-Request-Id: req-8d4939e3-77e7-4cd8-b443-7f7e268e5775 -{"extension": {"updated": "2011-12-23T00:00:00+00:00", "name": "Networks", "links": [], "namespace": "http://docs.openstack.org/compute/ext/networks/api/v1.1", "alias": "os-networks", "description": "Admin-only Network Management Extension"}} - -Apr 2, 2012 5:10:04 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 39 * LoggingFilter - Request received on thread main -39 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/OS-EXT-SRV-ATTR -39 > Accept: application/json -39 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 40 * LoggingFilter - Response received on thread main -40 < 200 -40 < Connection: keep-alive -40 < Content-Length: 265 -40 < Content-Type: application/json -40 < Date: Tue, 20 Mar 2012 18:16:30 GMT -40 < X-Compute-Request-Id: req-76b04baa-9b79-4b05-a96b-3f60e2278d94 -{"extension": {"updated": "2011-11-03T00:00:00+00:00", "name": "ExtendedServerAttributes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", "alias": "OS-EXT-SRV-ATTR", "description": "Extended Server Attributes support."}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 41 * LoggingFilter - Request received on thread main -41 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-keypairs -41 > Accept: application/json -41 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 42 * LoggingFilter - Response received on thread main -42 < 200 -42 < Connection: keep-alive -42 < Content-Length: 218 -42 < Content-Type: application/json -42 < Date: Tue, 20 Mar 2012 18:16:31 GMT -42 < X-Compute-Request-Id: req-1e799d6a-1c84-4414-b9fc-e281988bc932 -{"extension": {"updated": "2011-08-08T00:00:00+00:00", "name": "Keypairs", "links": [], "namespace": "http://docs.openstack.org/compute/ext/keypairs/api/v1.1", "alias": "os-keypairs", "description": "Keypair Support"}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 43 * LoggingFilter - Request received on thread main -43 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-volume-types -43 > Accept: application/json -43 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 44 * LoggingFilter - Response received on thread main -44 < 200 -44 < Connection: keep-alive -44 < Content-Length: 234 -44 < Content-Type: application/json -44 < Date: Tue, 20 Mar 2012 18:16:31 GMT -44 < X-Compute-Request-Id: req-8f153ea6-b58e-4b45-8bb9-519bdee4d1bb -{"extension": {"updated": "2011-08-24T00:00:00+00:00", "name": "VolumeTypes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/volume_types/api/v1.1", "alias": "os-volume-types", "description": "Volume types support"}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 45 * LoggingFilter - Request received on thread main -45 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-simple-tenant-usage -45 > Accept: application/json -45 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 46 * LoggingFilter - Response received on thread main -46 < 200 -46 < Connection: keep-alive -46 < Content-Length: 266 -46 < Content-Type: application/json -46 < Date: Tue, 20 Mar 2012 18:16:31 GMT -46 < X-Compute-Request-Id: req-f857b47d-bc35-4533-9f5d-f552c01f0f0b -{"extension": {"updated": "2011-08-19T00:00:00+00:00", "name": "SimpleTenantUsage", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-simple-tenant-usage/api/v1.1", "alias": "os-simple-tenant-usage", "description": "Simple tenant usage extension"}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 47 * LoggingFilter - Request received on thread main -47 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-floating-ip-pools -47 > Accept: application/json -47 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 48 * LoggingFilter - Response received on thread main -48 < 200 -48 < Connection: keep-alive -48 < Content-Length: 250 -48 < Content-Type: application/json -48 < Date: Tue, 20 Mar 2012 18:16:31 GMT -48 < X-Compute-Request-Id: req-6f5be56c-a752-4694-8f37-a38c5891a5f2 -{"extension": {"updated": "2012-01-04T00:00:00+00:00", "name": "Floating_ip_pools", "links": [], "namespace": "http://docs.openstack.org/compute/ext/floating_ip_pools/api/v1.1", "alias": "os-floating-ip-pools", "description": "Floating IPs support"}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 49 * LoggingFilter - Request received on thread main -49 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-server-start-stop -49 > Accept: application/json -49 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 50 * LoggingFilter - Response received on thread main -50 < 200 -50 < Connection: keep-alive -50 < Content-Length: 257 -50 < Content-Type: application/json -50 < Date: Tue, 20 Mar 2012 18:16:31 GMT -50 < X-Compute-Request-Id: req-86772157-2671-49dc-b5d3-84b2fffc6a77 -{"extension": {"updated": "2012-01-23T00:00:00+00:00", "name": "ServerStartStop", "links": [], "namespace": "http://docs.openstack.org/compute/ext/servers/api/v1.1", "alias": "os-server-start-stop", "description": "Start/Stop instance compute API support"}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 51 * LoggingFilter - Request received on thread main -51 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-quota-class-sets -51 > Accept: application/json -51 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 52 * LoggingFilter - Response received on thread main -52 < 200 -52 < Connection: keep-alive -52 < Content-Length: 257 -52 < Content-Type: application/json -52 < Date: Tue, 20 Mar 2012 18:16:31 GMT -52 < X-Compute-Request-Id: req-3d7b8009-26ce-4197-82f7-bd98bd56d857 -{"extension": {"updated": "2012-03-12T00:00:00+00:00", "name": "QuotaClasses", "links": [], "namespace": "http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1", "alias": "os-quota-class-sets", "description": "Quota classes management support"}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 53 * LoggingFilter - Request received on thread main -53 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-certificates -53 > Accept: application/json -53 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 54 * LoggingFilter - Response received on thread main -54 < 200 -54 < Connection: keep-alive -54 < Content-Length: 235 -54 < Content-Type: application/json -54 < Date: Tue, 20 Mar 2012 18:16:31 GMT -54 < X-Compute-Request-Id: req-0601464e-7ed0-4ae9-a4ce-113065faa345 -{"extension": {"updated": "2012-01-19T00:00:00+00:00", "name": "Certificates", "links": [], "namespace": "http://docs.openstack.org/compute/ext/certificates/api/v1.1", "alias": "os-certificates", "description": "Certificates support"}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 55 * LoggingFilter - Request received on thread main -55 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-console-output -55 > Accept: application/json -55 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 56 * LoggingFilter - Response received on thread main -56 < 200 -56 < Connection: keep-alive -56 < Content-Length: 271 -56 < Content-Type: application/json -56 < Date: Tue, 20 Mar 2012 18:16:31 GMT -56 < X-Compute-Request-Id: req-9767fede-c4d1-4308-bc8c-2faed91507e8 -{"extension": {"updated": "2011-12-08T00:00:00+00:00", "name": "Console_output", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-console-output/api/v2", "alias": "os-console-output", "description": "Console log output support, with tailing ability."}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 57 * LoggingFilter - Request received on thread main -57 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-flavor-manage -57 > Accept: application/json -57 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 58 * LoggingFilter - Response received on thread main -58 < 200 -58 < Connection: keep-alive -58 < Content-Length: 261 -58 < Content-Type: application/json -58 < Date: Tue, 20 Mar 2012 18:16:31 GMT -58 < X-Compute-Request-Id: req-0b9fba4a-2332-4f66-972e-70e6141d810f -{"extension": {"updated": "2012-01-19T00:00:00+00:00", "name": "FlavorManage", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_manage/api/v1.1", "alias": "os-flavor-manage", "description": "\n Flavor create/delete API support\n "}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 59 * LoggingFilter - Request received on thread main -59 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-cloudpipe -59 > Accept: application/json -59 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 60 * LoggingFilter - Response received on thread main -60 < 200 -60 < Connection: keep-alive -60 < Content-Length: 547 -60 < Content-Type: application/json -60 < Date: Tue, 20 Mar 2012 18:16:31 GMT -60 < X-Compute-Request-Id: req-7cfc713c-836e-4b7f-adab-f56847e60c0e -{"extension": {"updated": "2011-12-16T00:00:00+00:00", "name": "Cloudpipe", "links": [], "namespace": "http://docs.openstack.org/compute/ext/cloudpipe/api/v1.1", "alias": "os-cloudpipe", "description": "Adds actions to create cloudpipe instances.\n\n When running with the Vlan network mode, you need a mechanism to route\n from the public Internet to your vlans. This mechanism is known as a\n cloudpipe.\n\n At the time of creating this class, only OpenVPN is supported. Support for\n a SSH Bastion host is forthcoming.\n "}} - -Apr 2, 2012 5:10:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 61 * LoggingFilter - Request received on thread main -61 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/NMN -61 > Accept: application/json -61 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 62 * LoggingFilter - Response received on thread main -62 < 200 -62 < Connection: keep-alive -62 < Content-Length: 219 -62 < Content-Type: application/json -62 < Date: Tue, 20 Mar 2012 18:16:31 GMT -62 < X-Compute-Request-Id: req-65548b86-a055-4b8a-82f5-9bac7abee31f -{"extension": {"updated": "2011-06-09T00:00:00+00:00", "name": "Multinic", "links": [], "namespace": "http://docs.openstack.org/compute/ext/multinic/api/v1.1", "alias": "NMN", "description": "Multiple network support"}} - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 63 * LoggingFilter - Request received on thread main -63 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-users -63 > Accept: application/json -63 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 64 * LoggingFilter - Response received on thread main -64 < 200 -64 < Connection: keep-alive -64 < Content-Length: 232 -64 < Content-Type: application/json -64 < Date: Tue, 20 Mar 2012 18:16:32 GMT -64 < X-Compute-Request-Id: req-63447544-4eac-4e23-9304-1cd2b2bc7ed3 -{"extension": {"updated": "2011-08-08T00:00:00+00:00", "name": "Users", "links": [], "namespace": "http://docs.openstack.org/compute/ext/users/api/v1.1", "alias": "os-users", "description": "Allow admins to acces user information"}} - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 65 * LoggingFilter - Request received on thread main -65 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-admin-actions -65 > Accept: application/json -65 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 66 * LoggingFilter - Response received on thread main -66 < 200 -66 < Connection: keep-alive -66 < Content-Length: 386 -66 < Content-Type: application/json -66 < Date: Tue, 20 Mar 2012 18:16:32 GMT -66 < X-Compute-Request-Id: req-2df90c99-891e-490c-a483-9366a4b2a906 -{"extension": {"updated": "2011-09-20T00:00:00+00:00", "name": "AdminActions", "links": [], "namespace": "http://docs.openstack.org/compute/ext/admin-actions/api/v1.1", "alias": "os-admin-actions", "description": "Enable admin-only server actions\n\n Actions include: pause, unpause, suspend, resume, migrate,\n resetNetwork, injectNetworkInfo, lock, unlock, createBackup\n "}} - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 67 * LoggingFilter - Request received on thread main -67 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-server-action-list -67 > Accept: application/json -67 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 68 * LoggingFilter - Response received on thread main -68 < 200 -68 < Connection: keep-alive -68 < Content-Length: 275 -68 < Content-Type: application/json -68 < Date: Tue, 20 Mar 2012 18:16:32 GMT -68 < X-Compute-Request-Id: req-70f2599d-ebdb-4eb3-9be0-4de71f6da573 -{"extension": {"updated": "2011-12-21T00:00:00+00:00", "name": "ServerActionList", "links": [], "namespace": "http://docs.openstack.org/compute/ext/server-actions-list/api/v1.1", "alias": "os-server-action-list", "description": "Allow Admins to view pending server actions"}} - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 69 * LoggingFilter - Request received on thread main -69 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-rescue -69 > Accept: application/json -69 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 70 * LoggingFilter - Response received on thread main -70 < 200 -70 < Connection: keep-alive -70 < Content-Length: 217 -70 < Content-Type: application/json -70 < Date: Tue, 20 Mar 2012 18:16:32 GMT -70 < X-Compute-Request-Id: req-ca9e54be-964d-4784-a6b7-84d7e1dd730f -{"extension": {"updated": "2011-08-18T00:00:00+00:00", "name": "Rescue", "links": [], "namespace": "http://docs.openstack.org/compute/ext/rescue/api/v1.1", "alias": "os-rescue", "description": "Instance rescue mode"}} - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 71 * LoggingFilter - Request received on thread main -71 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions/os-floating-ips -71 > Accept: application/json -71 > X-Auth-Token: c92252cdf8ca441196859452a7b6c4ed - -Apr 2, 2012 5:10:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 72 * LoggingFilter - Response received on thread main -72 < 200 -72 < Connection: keep-alive -72 < Content-Length: 235 -72 < Content-Type: application/json -72 < Date: Tue, 20 Mar 2012 18:16:32 GMT -72 < X-Compute-Request-Id: req-91579780-8361-4a07-891e-63e887236c3c -{"extension": {"updated": "2011-06-16T00:00:00+00:00", "name": "Floating_ips", "links": [], "namespace": "http://docs.openstack.org/compute/ext/floating_ips/api/v1.1", "alias": "os-floating-ips", "description": "Floating IPs support"}} diff --git a/src/docbkx/compute_keypairs.txt b/src/docbkx/compute_keypairs.txt deleted file mode 100644 index f39f7a2b2..000000000 --- a/src/docbkx/compute_keypairs.txt +++ /dev/null @@ -1,127 +0,0 @@ -Apr 2, 2012 5:09:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"demo","password":"secret0"},"tenantName":"demo"}} - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2470 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:15:33 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T18:15:33Z", "id": "51800015932248b69260c714514b7b1d", "tenant": {"enabled": true, "id": "49ca8fb0aef0469996ca10eec7ff51a2", "name": "demo", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "76e2570dadf2413ba0349ea9583b6b76", "roles": [{"id": "fd9f96340215451cb5d7089ec091a9de", "name": "anotherrole"}, {"id": "31d8e7c333124a32a7ba5d117cd3d09a", "name": "Member"}], "name": "demo"}}} - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs -1 > Accept: application/json -1 > X-Auth-Token: 51800015932248b69260c714514b7b1d - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 16 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:15:33 GMT -2 < X-Compute-Request-Id: req-06120677-8bb9-477e-8476-1cd2cf793a41 -{"keypairs": []} - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 3 * LoggingFilter - Request received on thread main -3 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions -3 > Accept: application/json -3 > X-Auth-Token: 51800015932248b69260c714514b7b1d - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 4 * LoggingFilter - Response received on thread main -4 < 200 -4 < Connection: keep-alive -4 < Content-Length: 8609 -4 < Content-Type: application/json -4 < Date: Tue, 20 Mar 2012 18:15:33 GMT -4 < X-Compute-Request-Id: req-f1cf0f3c-d8b4-4aa8-90d8-eb71d00e8504 -{"extensions": [{"updated": "2011-09-27T00:00:00+00:00", "name": "DiskConfig", "links": [], "namespace": "http://docs.openstack.org/compute/ext/disk_config/api/v1.1", "alias": "OS-DCF", "description": "Disk Management Extension"}, {"updated": "2011-06-29T00:00:00+00:00", "name": "Hosts", "links": [], "namespace": "http://docs.openstack.org/compute/ext/hosts/api/v1.1", "alias": "os-hosts", "description": "Admin-only host administration"}, {"updated": "2011-07-19T00:00:00+00:00", "name": "SchedulerHints", "links": [], "namespace": "http://docs.openstack.org/compute/ext/scheduler-hints/api/v2", "alias": "os-scheduler-hints", "description": "Pass arbitrary key/value pairs to the scheduler"}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Quotas", "links": [], "namespace": "http://docs.openstack.org/compute/ext/quotas-sets/api/v1.1", "alias": "os-quota-sets", "description": "Quotas management support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Floating_ip_dns", "links": [], "namespace": "http://docs.openstack.org/ext/floating_ip_dns/api/v1.1", "alias": "os-floating-ip-dns", "description": "Floating IP DNS support"}, {"updated": "2011-09-14T00:00:00+00:00", "name": "FlavorExtraData", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1", "alias": "OS-FLV-EXT-DATA", "description": "Provide additional data for flavors"}, {"updated": "2011-06-23T00:00:00+00:00", "name": "FlavorExtraSpecs", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_specs/api/v1.1", "alias": "os-flavor-extra-specs", "description": "Instance type (flavor) extra specs"}, {"updated": "2011-07-21T00:00:00+00:00", "name": "SecurityGroups", "links": [], "namespace": "http://docs.openstack.org/compute/ext/securitygroups/api/v1.1", "alias": "security_groups", "description": "Security group support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Accounts", "links": [], "namespace": "http://docs.openstack.org/compute/ext/accounts/api/v1.1", "alias": "os-accounts", "description": "Admin-only access to accounts"}, {"updated": "2011-03-25T00:00:00+00:00", "name": "Volumes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/volumes/api/v1.1", "alias": "os-volumes", "description": "Volumes support"}, {"updated": "2011-11-03T00:00:00+00:00", "name": "ExtendedStatus", "links": [], "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", "alias": "OS-EXT-STS", "description": "Extended Status support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Consoles", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-consoles/api/v2", "alias": "os-consoles", "description": "Interactive Console support."}, {"updated": "2011-08-17T00:00:00+00:00", "name": "VirtualInterfaces", "links": [], "namespace": "http://docs.openstack.org/compute/ext/virtual_interfaces/api/v1.1", "alias": "virtual_interfaces", "description": "Virtual interface support"}, {"updated": "2012-01-12T00:00:00+00:00", "name": "Aggregates", "links": [], "namespace": "http://docs.openstack.org/compute/ext/aggregates/api/v1.1", "alias": "os-aggregates", "description": "Admin-only aggregate administration"}, {"updated": "2011-07-19T00:00:00+00:00", "name": "Createserverext", "links": [], "namespace": "http://docs.openstack.org/compute/ext/createserverext/api/v1.1", "alias": "os-create-server-ext", "description": "Extended support to the Create Server v1.1 API"}, {"updated": "2011-09-01T00:00:00+00:00", "name": "DeferredDelete", "links": [], "namespace": "http://docs.openstack.org/compute/ext/deferred-delete/api/v1.1", "alias": "os-deferred-delete", "description": "Instance deferred delete"}, {"updated": "2011-12-21T00:00:00+00:00", "name": "ServerDiagnostics", "links": [], "namespace": "http://docs.openstack.org/compute/ext/server-diagnostics/api/v1.1", "alias": "os-server-diagnostics", "description": "Allow Admins to view server diagnostics through server action"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Networks", "links": [], "namespace": "http://docs.openstack.org/compute/ext/networks/api/v1.1", "alias": "os-networks", "description": "Admin-only Network Management Extension"}, {"updated": "2011-11-03T00:00:00+00:00", "name": "ExtendedServerAttributes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", "alias": "OS-EXT-SRV-ATTR", "description": "Extended Server Attributes support."}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Keypairs", "links": [], "namespace": "http://docs.openstack.org/compute/ext/keypairs/api/v1.1", "alias": "os-keypairs", "description": "Keypair Support"}, {"updated": "2011-08-24T00:00:00+00:00", "name": "VolumeTypes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/volume_types/api/v1.1", "alias": "os-volume-types", "description": "Volume types support"}, {"updated": "2011-08-19T00:00:00+00:00", "name": "SimpleTenantUsage", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-simple-tenant-usage/api/v1.1", "alias": "os-simple-tenant-usage", "description": "Simple tenant usage extension"}, {"updated": "2012-01-04T00:00:00+00:00", "name": "Floating_ip_pools", "links": [], "namespace": "http://docs.openstack.org/compute/ext/floating_ip_pools/api/v1.1", "alias": "os-floating-ip-pools", "description": "Floating IPs support"}, {"updated": "2012-01-23T00:00:00+00:00", "name": "ServerStartStop", "links": [], "namespace": "http://docs.openstack.org/compute/ext/servers/api/v1.1", "alias": "os-server-start-stop", "description": "Start/Stop instance compute API support"}, {"updated": "2012-03-12T00:00:00+00:00", "name": "QuotaClasses", "links": [], "namespace": "http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1", "alias": "os-quota-class-sets", "description": "Quota classes management support"}, {"updated": "2012-01-19T00:00:00+00:00", "name": "Certificates", "links": [], "namespace": "http://docs.openstack.org/compute/ext/certificates/api/v1.1", "alias": "os-certificates", "description": "Certificates support"}, {"updated": "2011-12-08T00:00:00+00:00", "name": "Console_output", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-console-output/api/v2", "alias": "os-console-output", "description": "Console log output support, with tailing ability."}, {"updated": "2012-01-19T00:00:00+00:00", "name": "FlavorManage", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_manage/api/v1.1", "alias": "os-flavor-manage", "description": "\n Flavor create/delete API support\n "}, {"updated": "2011-12-16T00:00:00+00:00", "name": "Cloudpipe", "links": [], "namespace": "http://docs.openstack.org/compute/ext/cloudpipe/api/v1.1", "alias": "os-cloudpipe", "description": "Adds actions to create cloudpipe instances.\n\n When running with the Vlan network mode, you need a mechanism to route\n from the public Internet to your vlans. This mechanism is known as a\n cloudpipe.\n\n At the time of creating this class, only OpenVPN is supported. Support for\n a SSH Bastion host is forthcoming.\n "}, {"updated": "2011-06-09T00:00:00+00:00", "name": "Multinic", "links": [], "namespace": "http://docs.openstack.org/compute/ext/multinic/api/v1.1", "alias": "NMN", "description": "Multiple network support"}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Users", "links": [], "namespace": "http://docs.openstack.org/compute/ext/users/api/v1.1", "alias": "os-users", "description": "Allow admins to acces user information"}, {"updated": "2011-09-20T00:00:00+00:00", "name": "AdminActions", "links": [], "namespace": "http://docs.openstack.org/compute/ext/admin-actions/api/v1.1", "alias": "os-admin-actions", "description": "Enable admin-only server actions\n\n Actions include: pause, unpause, suspend, resume, migrate,\n resetNetwork, injectNetworkInfo, lock, unlock, createBackup\n "}, {"updated": "2011-12-21T00:00:00+00:00", "name": "ServerActionList", "links": [], "namespace": "http://docs.openstack.org/compute/ext/server-actions-list/api/v1.1", "alias": "os-server-action-list", "description": "Allow Admins to view pending server actions"}, {"updated": "2011-08-18T00:00:00+00:00", "name": "Rescue", "links": [], "namespace": "http://docs.openstack.org/compute/ext/rescue/api/v1.1", "alias": "os-rescue", "description": "Instance rescue mode"}, {"updated": "2011-06-16T00:00:00+00:00", "name": "Floating_ips", "links": [], "namespace": "http://docs.openstack.org/compute/ext/floating_ips/api/v1.1", "alias": "os-floating-ips", "description": "Floating IPs support"}]} - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 5 * LoggingFilter - Request received on thread main -5 > POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs -5 > Accept: application/json -5 > Content-Type: application/json -5 > X-Auth-Token: 51800015932248b69260c714514b7b1d -{"keypair":{"name":"0NwvE"}} - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 6 * LoggingFilter - Response received on thread main -6 < 200 -6 < Connection: keep-alive -6 < Content-Length: 1309 -6 < Content-Type: application/json -6 < Date: Tue, 20 Mar 2012 18:15:33 GMT -6 < X-Compute-Request-Id: req-41de8ea2-dc42-4ea9-a224-1ec6ea5cf662 -{"keypair": {"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQClJU34MZ5Y88wv4edvkGd35i0l7eOHTNazmrVf6JOH3lXNhkgYAWmJisC7plXBK700jDGFfVoUjoGjztzbZ+iccgOVawhZMgqNs7Hh+kqp0sCbBuqW0bZC1N02xOJQXuXQSVXjkNPr3w6BaLl+J1g0HbmDRUEPuqy+uU22DITOfw== stack@ubuntu\n", "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIICXAIBAAKBgQClJU34MZ5Y88wv4edvkGd35i0l7eOHTNazmrVf6JOH3lXNhkgY\nAWmJisC7plXBK700jDGFfVoUjoGjztzbZ+iccgOVawhZMgqNs7Hh+kqp0sCbBuqW\n0bZC1N02xOJQXuXQSVXjkNPr3w6BaLl+J1g0HbmDRUEPuqy+uU22DITOfwIDAQAB\nAoGAE/E/SxtizccS/y0+b2B2vinTheMGOM50lte101EYj62vmtP+XLe+8NcKkx5w\n+JS5kmDjkgUjHZxf11IhpXUUx63sMMcX7lcHg/tHW2Bb3k97u1jrJinHPawKOtaB\nCnmKsjKPus9DR9XCdNBBvdWMAbqCoWSfblNgZgK4pwr+OtECQQDN3j2egnJd2VH1\nLl/NZNy+KZGk8n8W6GEU93BbhkgYFBYdm2zSjBl6QD3XVjHypdof3L5TFZibklMF\nwT1Du9WzAkEAzVxw2/ZcWXg8fq5AQofG5ACXwaM970qh6x4IHlERL45CHroYlEpP\nOO7Jh3i1fQgIIpkJSd7FP1zh/kAjhvLWBQJBAI4p37F7cZDfhxpiSOQkt89WE26t\nyxe9p3T8HooFo/mEvXT6pN6MwvdKL6ppqppe78869++WJUmhdVWvCSiiKMMCQCyJ\nYLyDeFG6/rumhK8pDRxDeKX5BiSQNf9smuwgPq7mljZdu5jlaLr7Jl+n8Qw1orYG\nJHqNwo9UUHq4ZDwPDBUCQDtajx9//qFXo3Q5ugxj9RfNC4GvSRHhaOhbxVbhyWnf\nE4uo2TM67wxeZ5cIJ9qJMv+pLqoVQRN6uJJscoHJg+c=\n-----END RSA PRIVATE KEY-----\n", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "name": "0NwvE", "fingerprint": "92:b4:05:90:31:ae:36:eb:b4:e4:75:b1:1d:ab:ef:ff"}} - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 7 * LoggingFilter - Request received on thread main -7 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs -7 > Accept: application/json -7 > X-Auth-Token: 51800015932248b69260c714514b7b1d - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 8 * LoggingFilter - Response received on thread main -8 < 200 -8 < Connection: keep-alive -8 < Content-Length: 357 -8 < Content-Type: application/json -8 < Date: Tue, 20 Mar 2012 18:15:33 GMT -8 < X-Compute-Request-Id: req-6b2f2671-e9c7-4ac6-aeae-b42a25ea633c -{"keypairs": [{"keypair": {"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQClJU34MZ5Y88wv4edvkGd35i0l7eOHTNazmrVf6JOH3lXNhkgYAWmJisC7plXBK700jDGFfVoUjoGjztzbZ+iccgOVawhZMgqNs7Hh+kqp0sCbBuqW0bZC1N02xOJQXuXQSVXjkNPr3w6BaLl+J1g0HbmDRUEPuqy+uU22DITOfw== stack@ubuntu\n", "name": "0NwvE", "fingerprint": "92:b4:05:90:31:ae:36:eb:b4:e4:75:b1:1d:ab:ef:ff"}}]} - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 9 * LoggingFilter - Request received on thread main -9 > DELETE http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs/0NwvE -9 > X-Auth-Token: 51800015932248b69260c714514b7b1d - -Apr 2, 2012 5:09:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 10 * LoggingFilter - Response received on thread main -10 < 202 -10 < Connection: keep-alive -10 < Content-Length: 0 -10 < Content-Type: text/html; charset=UTF-8 -10 < Date: Tue, 20 Mar 2012 18:15:33 GMT - -Apr 2, 2012 5:09:08 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 11 * LoggingFilter - Request received on thread main -11 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs -11 > Accept: application/json -11 > X-Auth-Token: 51800015932248b69260c714514b7b1d - -Apr 2, 2012 5:09:08 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 12 * LoggingFilter - Response received on thread main -12 < 200 -12 < Connection: keep-alive -12 < Content-Length: 16 -12 < Content-Type: application/json -12 < Date: Tue, 20 Mar 2012 18:15:33 GMT -12 < X-Compute-Request-Id: req-1f4fb63d-9281-424a-8129-8e22a5609fba -{"keypairs": []} - -Apr 2, 2012 5:09:08 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 13 * LoggingFilter - Request received on thread main -13 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-keypairs -13 > Accept: application/json -13 > X-Auth-Token: 51800015932248b69260c714514b7b1d - -Apr 2, 2012 5:09:08 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 14 * LoggingFilter - Response received on thread main -14 < 200 -14 < Connection: keep-alive -14 < Content-Length: 16 -14 < Content-Type: application/json -14 < Date: Tue, 20 Mar 2012 18:15:34 GMT -14 < X-Compute-Request-Id: req-8010ad80-c6ee-4de5-9056-d0ad65f23e4e -{"keypairs": []} \ No newline at end of file diff --git a/src/docbkx/compute_security_groups.txt b/src/docbkx/compute_security_groups.txt deleted file mode 100644 index f637e813d..000000000 --- a/src/docbkx/compute_security_groups.txt +++ /dev/null @@ -1,190 +0,0 @@ -Apr 2, 2012 5:08:18 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"demo","password":"secret0"},"tenantName":"demo"}} - -Apr 2, 2012 5:08:18 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2470 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:14:44 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T18:14:44Z", "id": "3ff4ae0cba7e4ee68ac2c403b90cb725", "tenant": {"enabled": true, "id": "49ca8fb0aef0469996ca10eec7ff51a2", "name": "demo", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "76e2570dadf2413ba0349ea9583b6b76", "roles": [{"id": "fd9f96340215451cb5d7089ec091a9de", "name": "anotherrole"}, {"id": "31d8e7c333124a32a7ba5d117cd3d09a", "name": "Member"}], "name": "demo"}}} - -Apr 2, 2012 5:08:18 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/extensions -1 > Accept: application/json -1 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 8609 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:14:44 GMT -2 < X-Compute-Request-Id: req-67712aee-cf0b-46a3-955c-c7991f1ef22a -{"extensions": [{"updated": "2011-09-27T00:00:00+00:00", "name": "DiskConfig", "links": [], "namespace": "http://docs.openstack.org/compute/ext/disk_config/api/v1.1", "alias": "OS-DCF", "description": "Disk Management Extension"}, {"updated": "2011-06-29T00:00:00+00:00", "name": "Hosts", "links": [], "namespace": "http://docs.openstack.org/compute/ext/hosts/api/v1.1", "alias": "os-hosts", "description": "Admin-only host administration"}, {"updated": "2011-07-19T00:00:00+00:00", "name": "SchedulerHints", "links": [], "namespace": "http://docs.openstack.org/compute/ext/scheduler-hints/api/v2", "alias": "os-scheduler-hints", "description": "Pass arbitrary key/value pairs to the scheduler"}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Quotas", "links": [], "namespace": "http://docs.openstack.org/compute/ext/quotas-sets/api/v1.1", "alias": "os-quota-sets", "description": "Quotas management support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Floating_ip_dns", "links": [], "namespace": "http://docs.openstack.org/ext/floating_ip_dns/api/v1.1", "alias": "os-floating-ip-dns", "description": "Floating IP DNS support"}, {"updated": "2011-09-14T00:00:00+00:00", "name": "FlavorExtraData", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_data/api/v1.1", "alias": "OS-FLV-EXT-DATA", "description": "Provide additional data for flavors"}, {"updated": "2011-06-23T00:00:00+00:00", "name": "FlavorExtraSpecs", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_extra_specs/api/v1.1", "alias": "os-flavor-extra-specs", "description": "Instance type (flavor) extra specs"}, {"updated": "2011-07-21T00:00:00+00:00", "name": "SecurityGroups", "links": [], "namespace": "http://docs.openstack.org/compute/ext/securitygroups/api/v1.1", "alias": "security_groups", "description": "Security group support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Accounts", "links": [], "namespace": "http://docs.openstack.org/compute/ext/accounts/api/v1.1", "alias": "os-accounts", "description": "Admin-only access to accounts"}, {"updated": "2011-03-25T00:00:00+00:00", "name": "Volumes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/volumes/api/v1.1", "alias": "os-volumes", "description": "Volumes support"}, {"updated": "2011-11-03T00:00:00+00:00", "name": "ExtendedStatus", "links": [], "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", "alias": "OS-EXT-STS", "description": "Extended Status support"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Consoles", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-consoles/api/v2", "alias": "os-consoles", "description": "Interactive Console support."}, {"updated": "2011-08-17T00:00:00+00:00", "name": "VirtualInterfaces", "links": [], "namespace": "http://docs.openstack.org/compute/ext/virtual_interfaces/api/v1.1", "alias": "virtual_interfaces", "description": "Virtual interface support"}, {"updated": "2012-01-12T00:00:00+00:00", "name": "Aggregates", "links": [], "namespace": "http://docs.openstack.org/compute/ext/aggregates/api/v1.1", "alias": "os-aggregates", "description": "Admin-only aggregate administration"}, {"updated": "2011-07-19T00:00:00+00:00", "name": "Createserverext", "links": [], "namespace": "http://docs.openstack.org/compute/ext/createserverext/api/v1.1", "alias": "os-create-server-ext", "description": "Extended support to the Create Server v1.1 API"}, {"updated": "2011-09-01T00:00:00+00:00", "name": "DeferredDelete", "links": [], "namespace": "http://docs.openstack.org/compute/ext/deferred-delete/api/v1.1", "alias": "os-deferred-delete", "description": "Instance deferred delete"}, {"updated": "2011-12-21T00:00:00+00:00", "name": "ServerDiagnostics", "links": [], "namespace": "http://docs.openstack.org/compute/ext/server-diagnostics/api/v1.1", "alias": "os-server-diagnostics", "description": "Allow Admins to view server diagnostics through server action"}, {"updated": "2011-12-23T00:00:00+00:00", "name": "Networks", "links": [], "namespace": "http://docs.openstack.org/compute/ext/networks/api/v1.1", "alias": "os-networks", "description": "Admin-only Network Management Extension"}, {"updated": "2011-11-03T00:00:00+00:00", "name": "ExtendedServerAttributes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", "alias": "OS-EXT-SRV-ATTR", "description": "Extended Server Attributes support."}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Keypairs", "links": [], "namespace": "http://docs.openstack.org/compute/ext/keypairs/api/v1.1", "alias": "os-keypairs", "description": "Keypair Support"}, {"updated": "2011-08-24T00:00:00+00:00", "name": "VolumeTypes", "links": [], "namespace": "http://docs.openstack.org/compute/ext/volume_types/api/v1.1", "alias": "os-volume-types", "description": "Volume types support"}, {"updated": "2011-08-19T00:00:00+00:00", "name": "SimpleTenantUsage", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-simple-tenant-usage/api/v1.1", "alias": "os-simple-tenant-usage", "description": "Simple tenant usage extension"}, {"updated": "2012-01-04T00:00:00+00:00", "name": "Floating_ip_pools", "links": [], "namespace": "http://docs.openstack.org/compute/ext/floating_ip_pools/api/v1.1", "alias": "os-floating-ip-pools", "description": "Floating IPs support"}, {"updated": "2012-01-23T00:00:00+00:00", "name": "ServerStartStop", "links": [], "namespace": "http://docs.openstack.org/compute/ext/servers/api/v1.1", "alias": "os-server-start-stop", "description": "Start/Stop instance compute API support"}, {"updated": "2012-03-12T00:00:00+00:00", "name": "QuotaClasses", "links": [], "namespace": "http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1", "alias": "os-quota-class-sets", "description": "Quota classes management support"}, {"updated": "2012-01-19T00:00:00+00:00", "name": "Certificates", "links": [], "namespace": "http://docs.openstack.org/compute/ext/certificates/api/v1.1", "alias": "os-certificates", "description": "Certificates support"}, {"updated": "2011-12-08T00:00:00+00:00", "name": "Console_output", "links": [], "namespace": "http://docs.openstack.org/compute/ext/os-console-output/api/v2", "alias": "os-console-output", "description": "Console log output support, with tailing ability."}, {"updated": "2012-01-19T00:00:00+00:00", "name": "FlavorManage", "links": [], "namespace": "http://docs.openstack.org/compute/ext/flavor_manage/api/v1.1", "alias": "os-flavor-manage", "description": "\n Flavor create/delete API support\n "}, {"updated": "2011-12-16T00:00:00+00:00", "name": "Cloudpipe", "links": [], "namespace": "http://docs.openstack.org/compute/ext/cloudpipe/api/v1.1", "alias": "os-cloudpipe", "description": "Adds actions to create cloudpipe instances.\n\n When running with the Vlan network mode, you need a mechanism to route\n from the public Internet to your vlans. This mechanism is known as a\n cloudpipe.\n\n At the time of creating this class, only OpenVPN is supported. Support for\n a SSH Bastion host is forthcoming.\n "}, {"updated": "2011-06-09T00:00:00+00:00", "name": "Multinic", "links": [], "namespace": "http://docs.openstack.org/compute/ext/multinic/api/v1.1", "alias": "NMN", "description": "Multiple network support"}, {"updated": "2011-08-08T00:00:00+00:00", "name": "Users", "links": [], "namespace": "http://docs.openstack.org/compute/ext/users/api/v1.1", "alias": "os-users", "description": "Allow admins to acces user information"}, {"updated": "2011-09-20T00:00:00+00:00", "name": "AdminActions", "links": [], "namespace": "http://docs.openstack.org/compute/ext/admin-actions/api/v1.1", "alias": "os-admin-actions", "description": "Enable admin-only server actions\n\n Actions include: pause, unpause, suspend, resume, migrate,\n resetNetwork, injectNetworkInfo, lock, unlock, createBackup\n "}, {"updated": "2011-12-21T00:00:00+00:00", "name": "ServerActionList", "links": [], "namespace": "http://docs.openstack.org/compute/ext/server-actions-list/api/v1.1", "alias": "os-server-action-list", "description": "Allow Admins to view pending server actions"}, {"updated": "2011-08-18T00:00:00+00:00", "name": "Rescue", "links": [], "namespace": "http://docs.openstack.org/compute/ext/rescue/api/v1.1", "alias": "os-rescue", "description": "Instance rescue mode"}, {"updated": "2011-06-16T00:00:00+00:00", "name": "Floating_ips", "links": [], "namespace": "http://docs.openstack.org/compute/ext/floating_ips/api/v1.1", "alias": "os-floating-ips", "description": "Floating IPs support"}]} - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 3 * LoggingFilter - Request received on thread main -3 > POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups -3 > Accept: application/json -3 > Content-Type: application/json -3 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 -{"security_group":{"name":"GvOLAdTZvmCVvoKt4uk8rle6NPXawe0S6ww4Vri89BMCbVk4GdteGdOsyUypZQ","description":"L33evMS0a5mCSTRVmOE0T7Sxs3ulFDRUyUuaWcmHUANaX3GWk40aT2R330VqE9AJZcTrSqfdNruptzogqO6F7XPWZFUc00lwixFs5MK8QuG9wGYTuq3SPdqa6J1i7sMjG1XUyiRgFNThJ4ZbF2wZztgVqdXxaDX4r5U0e8qqFapXsZuW6UHZX1VJrtLMxUyJKAAtCN5IvgJgJYX479iAhb1lytNQG9EIU8cQpmcPy4g6AkFvXxGnch"}} - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 4 * LoggingFilter - Response received on thread main -4 < 200 -4 < Connection: keep-alive -4 < Content-Length: 430 -4 < Content-Type: application/json -4 < Date: Tue, 20 Mar 2012 18:14:45 GMT -4 < X-Compute-Request-Id: req-756220ca-3a35-46e2-922d-ab11013cf0df -{"security_group": {"rules": [], "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "id": 2, "name": "GvOLAdTZvmCVvoKt4uk8rle6NPXawe0S6ww4Vri89BMCbVk4GdteGdOsyUypZQ", "description": "L33evMS0a5mCSTRVmOE0T7Sxs3ulFDRUyUuaWcmHUANaX3GWk40aT2R330VqE9AJZcTrSqfdNruptzogqO6F7XPWZFUc00lwixFs5MK8QuG9wGYTuq3SPdqa6J1i7sMjG1XUyiRgFNThJ4ZbF2wZztgVqdXxaDX4r5U0e8qqFapXsZuW6UHZX1VJrtLMxUyJKAAtCN5IvgJgJYX479iAhb1lytNQG9EIU8cQpmcPy4g6AkFvXxGnch"}} - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 5 * LoggingFilter - Request received on thread main -5 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups/2 -5 > Accept: application/json -5 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 6 * LoggingFilter - Response received on thread main -6 < 200 -6 < Connection: keep-alive -6 < Content-Length: 430 -6 < Content-Type: application/json -6 < Date: Tue, 20 Mar 2012 18:14:45 GMT -6 < X-Compute-Request-Id: req-8dfef523-b2cc-4e44-af1c-e47a56a6a122 -{"security_group": {"rules": [], "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "id": 2, "name": "GvOLAdTZvmCVvoKt4uk8rle6NPXawe0S6ww4Vri89BMCbVk4GdteGdOsyUypZQ", "description": "L33evMS0a5mCSTRVmOE0T7Sxs3ulFDRUyUuaWcmHUANaX3GWk40aT2R330VqE9AJZcTrSqfdNruptzogqO6F7XPWZFUc00lwixFs5MK8QuG9wGYTuq3SPdqa6J1i7sMjG1XUyiRgFNThJ4ZbF2wZztgVqdXxaDX4r5U0e8qqFapXsZuW6UHZX1VJrtLMxUyJKAAtCN5IvgJgJYX479iAhb1lytNQG9EIU8cQpmcPy4g6AkFvXxGnch"}} - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 7 * LoggingFilter - Request received on thread main -7 > POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-group-rules -7 > Accept: application/json -7 > Content-Type: application/json -7 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 -{"security_group_rule":{"parent_group_id":2,"from_port":1234,"to_port":5678,"ip_protocol":"tcp","cidr":"1.2.3.4/32"}} - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 8 * LoggingFilter - Response received on thread main -8 < 200 -8 < Connection: keep-alive -8 < Content-Length: 163 -8 < Content-Type: application/json -8 < Date: Tue, 20 Mar 2012 18:14:45 GMT -8 < X-Compute-Request-Id: req-d07a36b3-550e-4521-aae0-7bd443c36cb1 -{"security_group_rule": {"from_port": 1234, "group": {}, "ip_protocol": "tcp", "to_port": 5678, "parent_group_id": 2, "ip_range": {"cidr": "1.2.3.4/32"}, "id": 1}} - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 9 * LoggingFilter - Request received on thread main -9 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups/2 -9 > Accept: application/json -9 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 10 * LoggingFilter - Response received on thread main -10 < 200 -10 < Connection: keep-alive -10 < Content-Length: 568 -10 < Content-Type: application/json -10 < Date: Tue, 20 Mar 2012 18:14:45 GMT -10 < X-Compute-Request-Id: req-95b5d395-90eb-49b2-a0d4-0c3ea5abd783 -{"security_group": {"rules": [{"from_port": 1234, "group": {}, "ip_protocol": "tcp", "to_port": 5678, "parent_group_id": 2, "ip_range": {"cidr": "1.2.3.4/32"}, "id": 1}], "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "id": 2, "name": "GvOLAdTZvmCVvoKt4uk8rle6NPXawe0S6ww4Vri89BMCbVk4GdteGdOsyUypZQ", "description": "L33evMS0a5mCSTRVmOE0T7Sxs3ulFDRUyUuaWcmHUANaX3GWk40aT2R330VqE9AJZcTrSqfdNruptzogqO6F7XPWZFUc00lwixFs5MK8QuG9wGYTuq3SPdqa6J1i7sMjG1XUyiRgFNThJ4ZbF2wZztgVqdXxaDX4r5U0e8qqFapXsZuW6UHZX1VJrtLMxUyJKAAtCN5IvgJgJYX479iAhb1lytNQG9EIU8cQpmcPy4g6AkFvXxGnch"}} - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 11 * LoggingFilter - Request received on thread main -11 > DELETE http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-group-rules/1 -11 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 12 * LoggingFilter - Response received on thread main -12 < 202 -12 < Connection: keep-alive -12 < Content-Length: 0 -12 < Content-Type: text/html; charset=UTF-8 -12 < Date: Tue, 20 Mar 2012 18:14:45 GMT - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 13 * LoggingFilter - Request received on thread main -13 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups/2 -13 > Accept: application/json -13 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 14 * LoggingFilter - Response received on thread main -14 < 200 -14 < Connection: keep-alive -14 < Content-Length: 430 -14 < Content-Type: application/json -14 < Date: Tue, 20 Mar 2012 18:14:45 GMT -14 < X-Compute-Request-Id: req-e6d5d7b2-dca7-4af0-a1fd-05a2794e94fd -{"security_group": {"rules": [], "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "id": 2, "name": "GvOLAdTZvmCVvoKt4uk8rle6NPXawe0S6ww4Vri89BMCbVk4GdteGdOsyUypZQ", "description": "L33evMS0a5mCSTRVmOE0T7Sxs3ulFDRUyUuaWcmHUANaX3GWk40aT2R330VqE9AJZcTrSqfdNruptzogqO6F7XPWZFUc00lwixFs5MK8QuG9wGYTuq3SPdqa6J1i7sMjG1XUyiRgFNThJ4ZbF2wZztgVqdXxaDX4r5U0e8qqFapXsZuW6UHZX1VJrtLMxUyJKAAtCN5IvgJgJYX479iAhb1lytNQG9EIU8cQpmcPy4g6AkFvXxGnch"}} - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 15 * LoggingFilter - Request received on thread main -15 > DELETE http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups/2 -15 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 16 * LoggingFilter - Response received on thread main -16 < 202 -16 < Connection: keep-alive -16 < Content-Length: 0 -16 < Content-Type: text/html; charset=UTF-8 -16 < Date: Tue, 20 Mar 2012 18:14:45 GMT - -Apr 2, 2012 5:08:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 17 * LoggingFilter - Request received on thread main -17 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups/2 -17 > Accept: application/json -17 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 18 * LoggingFilter - Response received on thread main -18 < 404 -18 < Connection: keep-alive -18 < Content-Length: 73 -18 < Content-Type: application/json; charset=UTF-8 -18 < Date: Tue, 20 Mar 2012 18:14:45 GMT -18 < X-Compute-Request-Id: req-42965edb-b3a9-4e13-9d2d-ac571c27df5e -{"itemNotFound": {"message": "Security group 2 not found.", "code": 404}} - -Apr 2, 2012 5:08:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 19 * LoggingFilter - Request received on thread main -19 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups -19 > Accept: application/json -19 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 20 * LoggingFilter - Response received on thread main -20 < 200 -20 < Connection: keep-alive -20 < Content-Length: 139 -20 < Content-Type: application/json -20 < Date: Tue, 20 Mar 2012 18:14:46 GMT -20 < X-Compute-Request-Id: req-c54c8859-21a7-4ef1-af31-d00f67fb9da5 -{"security_groups": [{"rules": [], "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "id": 1, "name": "default", "description": "default"}]} - -Apr 2, 2012 5:08:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 21 * LoggingFilter - Request received on thread main -21 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/os-security-groups/1 -21 > Accept: application/json -21 > X-Auth-Token: 3ff4ae0cba7e4ee68ac2c403b90cb725 - -Apr 2, 2012 5:08:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 22 * LoggingFilter - Response received on thread main -22 < 200 -22 < Connection: keep-alive -22 < Content-Length: 136 -22 < Content-Type: application/json -22 < Date: Tue, 20 Mar 2012 18:14:46 GMT -22 < X-Compute-Request-Id: req-80043593-7691-4bd5-8af2-b39304b2f462 -{"security_group": {"rules": [], "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "id": 1, "name": "default", "description": "default"}} \ No newline at end of file diff --git a/src/docbkx/compute_servers.txt b/src/docbkx/compute_servers.txt deleted file mode 100644 index d41228deb..000000000 --- a/src/docbkx/compute_servers.txt +++ /dev/null @@ -1,448 +0,0 @@ -Apr 2, 2012 5:07:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"demo","password":"secret0"},"tenantName":"demo"}} - -Apr 2, 2012 5:07:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2470 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:13:31 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T18:13:31Z", "id": "55b7c585063f43cb8d21290b20f9e1b3", "tenant": {"enabled": true, "id": "49ca8fb0aef0469996ca10eec7ff51a2", "name": "demo", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "76e2570dadf2413ba0349ea9583b6b76", "roles": [{"id": "fd9f96340215451cb5d7089ec091a9de", "name": "anotherrole"}, {"id": "31d8e7c333124a32a7ba5d117cd3d09a", "name": "Member"}], "name": "demo"}}} - -Apr 2, 2012 5:07:05 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/detail -1 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 1738 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:13:32 GMT -2 < X-Compute-Request-Id: req-d214e11c-cefc-4a71-ad85-42d6cafe59ac -{"flavors": [{"vcpus": 1, "disk": 0, "name": "m1.tiny", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "ram": 512, "id": "1", "swap": ""}, {"vcpus": 1, "disk": 10, "name": "m1.small", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/2", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/2", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 20, "ram": 2048, "id": "2", "swap": ""}, {"vcpus": 2, "disk": 10, "name": "m1.medium", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/3", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/3", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 40, "ram": 4096, "id": "3", "swap": ""}, {"vcpus": 4, "disk": 10, "name": "m1.large", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/4", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/4", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 80, "ram": 8192, "id": "4", "swap": ""}, {"vcpus": 8, "disk": 10, "name": "m1.xlarge", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/5", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/5", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 160, "ram": 16384, "id": "5", "swap": ""}]} - -Apr 2, 2012 5:07:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 3 * LoggingFilter - Request received on thread main -3 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/detail -3 > Accept: application/json -3 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 4 * LoggingFilter - Response received on thread main -4 < 200 -4 < Connection: keep-alive -4 < Content-Length: 2199 -4 < Content-Type: application/json -4 < Date: Tue, 20 Mar 2012 18:13:32 GMT -4 < X-Compute-Request-Id: req-683ec1b3-5fbe-4b7b-9264-7aec6601ad87 -{"images": [{"status": "ACTIVE", "updated": "2012-03-20T17:32:23Z", "name": "cirros-0.3.0-x86_64-uec", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:22Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "metadata": {"kernel_id": "c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "ramdisk_id": "8b1c8692-1817-4ecf-8a88-72b82266de93"}}, {"status": "ACTIVE", "updated": "2012-03-20T17:32:22Z", "name": "cirros-0.3.0-x86_64-uec-ramdisk", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:22Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "8b1c8692-1817-4ecf-8a88-72b82266de93", "metadata": {}}, {"status": "ACTIVE", "updated": "2012-03-20T17:32:21Z", "name": "cirros-0.3.0-x86_64-uec-kernel", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:21Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "metadata": {}}]} - -Apr 2, 2012 5:07:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 5 * LoggingFilter - Request received on thread main -5 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/detail -5 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 6 * LoggingFilter - Response received on thread main -6 < 200 -6 < Connection: keep-alive -6 < Content-Length: 1738 -6 < Content-Type: application/json -6 < Date: Tue, 20 Mar 2012 18:13:32 GMT -6 < X-Compute-Request-Id: req-78d968cd-93fd-41d1-9108-decc7472304a -{"flavors": [{"vcpus": 1, "disk": 0, "name": "m1.tiny", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 0, "ram": 512, "id": "1", "swap": ""}, {"vcpus": 1, "disk": 10, "name": "m1.small", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/2", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/2", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 20, "ram": 2048, "id": "2", "swap": ""}, {"vcpus": 2, "disk": 10, "name": "m1.medium", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/3", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/3", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 40, "ram": 4096, "id": "3", "swap": ""}, {"vcpus": 4, "disk": 10, "name": "m1.large", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/4", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/4", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 80, "ram": 8192, "id": "4", "swap": ""}, {"vcpus": 8, "disk": 10, "name": "m1.xlarge", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/5", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/5", "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": 160, "ram": 16384, "id": "5", "swap": ""}]} - -org.openstack.model.compute.nova.NovaServerForCreate@75f2edd2 -Apr 2, 2012 5:07:06 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 7 * LoggingFilter - Request received on thread main -7 > POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers -7 > Accept: application/json -7 > Content-Type: application/json -7 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 -{"server":{"name":"VGVpUeSzOk","imageRef":"d00e8cef-a05f-4d53-bace-0289b43c15bf","flavorRef":"1","configDrive":false}} - -Apr 2, 2012 5:07:07 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 8 * LoggingFilter - Response received on thread main -8 < 202 -8 < Connection: keep-alive -8 < Content-Length: 398 -8 < Content-Type: application/json -8 < Date: Tue, 20 Mar 2012 18:13:33 GMT -8 < Location: http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -8 < X-Compute-Request-Id: req-4c4b453f-f272-4d3e-99f9-e0f748ae10cc -{"server": {"OS-DCF:diskConfig": "MANUAL", "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "adminPass": "8koc7wb4WtFD"}} - -Apr 2, 2012 5:07:10 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 9 * LoggingFilter - Request received on thread pool-2-thread-1 -9 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -9 > Accept: application/json -9 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:13 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 10 * LoggingFilter - Response received on thread pool-2-thread-1 -10 < 200 -10 < Connection: keep-alive -10 < Content-Length: 1205 -10 < Content-Type: application/json -10 < Date: Tue, 20 Mar 2012 18:13:36 GMT -10 < X-Compute-Request-Id: req-70435b7d-e9d5-44b1-a711-86a6caf927bf -{"server": {"OS-EXT-STS:task_state": "networking", "addresses": {}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:33Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:13 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 11 * LoggingFilter - Request received on thread pool-2-thread-1 -11 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -11 > Accept: application/json -11 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 12 * LoggingFilter - Response received on thread pool-2-thread-1 -12 < 200 -12 < Connection: keep-alive -12 < Content-Length: 1205 -12 < Content-Type: application/json -12 < Date: Tue, 20 Mar 2012 18:13:40 GMT -12 < X-Compute-Request-Id: req-022f3812-3d9a-443a-9ca5-6d55f2cdbd26 -{"server": {"OS-EXT-STS:task_state": "networking", "addresses": {}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:33Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 13 * LoggingFilter - Request received on thread pool-2-thread-1 -13 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -13 > Accept: application/json -13 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 14 * LoggingFilter - Response received on thread pool-2-thread-1 -14 < 200 -14 < Connection: keep-alive -14 < Content-Length: 1205 -14 < Content-Type: application/json -14 < Date: Tue, 20 Mar 2012 18:13:40 GMT -14 < X-Compute-Request-Id: req-6980a823-c875-4b27-9981-f5cb6cc638d4 -{"server": {"OS-EXT-STS:task_state": "networking", "addresses": {}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:33Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 15 * LoggingFilter - Request received on thread pool-2-thread-1 -15 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -15 > Accept: application/json -15 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 16 * LoggingFilter - Response received on thread pool-2-thread-1 -16 < 200 -16 < Connection: keep-alive -16 < Content-Length: 1205 -16 < Content-Type: application/json -16 < Date: Tue, 20 Mar 2012 18:13:40 GMT -16 < X-Compute-Request-Id: req-7a96d2cd-94ff-4e1a-9ef9-5331905a84f4 -{"server": {"OS-EXT-STS:task_state": "networking", "addresses": {}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:33Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 17 * LoggingFilter - Request received on thread pool-2-thread-1 -17 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -17 > Accept: application/json -17 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 18 * LoggingFilter - Response received on thread pool-2-thread-1 -18 < 200 -18 < Connection: keep-alive -18 < Content-Length: 1205 -18 < Content-Type: application/json -18 < Date: Tue, 20 Mar 2012 18:13:41 GMT -18 < X-Compute-Request-Id: req-0dbd810d-e7ed-4868-a870-61ddcec7fd0a -{"server": {"OS-EXT-STS:task_state": "networking", "addresses": {}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:33Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 19 * LoggingFilter - Request received on thread pool-2-thread-1 -19 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -19 > Accept: application/json -19 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:15 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 20 * LoggingFilter - Response received on thread pool-2-thread-1 -20 < 200 -20 < Connection: keep-alive -20 < Content-Length: 1205 -20 < Content-Type: application/json -20 < Date: Tue, 20 Mar 2012 18:13:41 GMT -20 < X-Compute-Request-Id: req-8d4b9683-9c65-49f7-8ac1-be09a13279a8 -{"server": {"OS-EXT-STS:task_state": "networking", "addresses": {}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:33Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:16 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 21 * LoggingFilter - Request received on thread pool-2-thread-1 -21 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -21 > Accept: application/json -21 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:16 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 22 * LoggingFilter - Response received on thread pool-2-thread-1 -22 < 200 -22 < Connection: keep-alive -22 < Content-Length: 1250 -22 < Content-Type: application/json -22 < Date: Tue, 20 Mar 2012 18:13:42 GMT -22 < X-Compute-Request-Id: req-db5bed77-2bb6-4d5e-8f5d-eb28763f0c76 -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 23 * LoggingFilter - Request received on thread pool-2-thread-1 -23 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -23 > Accept: application/json -23 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 24 * LoggingFilter - Response received on thread pool-2-thread-1 -24 < 200 -24 < Connection: keep-alive -24 < Content-Length: 1250 -24 < Content-Type: application/json -24 < Date: Tue, 20 Mar 2012 18:13:43 GMT -24 < X-Compute-Request-Id: req-07c5e0e4-f414-40bc-ba52-636cb7a542cf -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:18 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 25 * LoggingFilter - Request received on thread pool-2-thread-1 -25 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -25 > Accept: application/json -25 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 26 * LoggingFilter - Response received on thread pool-2-thread-1 -26 < 200 -26 < Connection: keep-alive -26 < Content-Length: 1250 -26 < Content-Type: application/json -26 < Date: Tue, 20 Mar 2012 18:13:45 GMT -26 < X-Compute-Request-Id: req-94957fbc-aa15-4f3f-acc9-9f878fdbe2aa -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 27 * LoggingFilter - Request received on thread pool-2-thread-1 -27 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -27 > Accept: application/json -27 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:19 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 28 * LoggingFilter - Response received on thread pool-2-thread-1 -28 < 200 -28 < Connection: keep-alive -28 < Content-Length: 1250 -28 < Content-Type: application/json -28 < Date: Tue, 20 Mar 2012 18:13:45 GMT -28 < X-Compute-Request-Id: req-64be54f8-78f9-45b8-8113-de0d02b1b3e8 -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 29 * LoggingFilter - Request received on thread pool-2-thread-1 -29 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -29 > Accept: application/json -29 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 30 * LoggingFilter - Response received on thread pool-2-thread-1 -30 < 200 -30 < Connection: keep-alive -30 < Content-Length: 1250 -30 < Content-Type: application/json -30 < Date: Tue, 20 Mar 2012 18:13:47 GMT -30 < X-Compute-Request-Id: req-83f2a0cf-ba92-480e-b1f1-3381eb78f67b -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 31 * LoggingFilter - Request received on thread pool-2-thread-1 -31 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -31 > Accept: application/json -31 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:22 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 32 * LoggingFilter - Response received on thread pool-2-thread-1 -32 < 200 -32 < Connection: keep-alive -32 < Content-Length: 1250 -32 < Content-Type: application/json -32 < Date: Tue, 20 Mar 2012 18:13:47 GMT -32 < X-Compute-Request-Id: req-87bf1cd7-d7ce-44d3-b562-32782ee2a9b1 -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:22 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 33 * LoggingFilter - Request received on thread pool-2-thread-1 -33 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -33 > Accept: application/json -33 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:22 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 34 * LoggingFilter - Response received on thread pool-2-thread-1 -34 < 200 -34 < Connection: keep-alive -34 < Content-Length: 1250 -34 < Content-Type: application/json -34 < Date: Tue, 20 Mar 2012 18:13:48 GMT -34 < X-Compute-Request-Id: req-b1a5b82a-c29a-4f30-9f47-70aedda3d180 -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:23 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 35 * LoggingFilter - Request received on thread pool-2-thread-1 -35 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -35 > Accept: application/json -35 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:24 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 36 * LoggingFilter - Response received on thread pool-2-thread-1 -36 < 200 -36 < Connection: keep-alive -36 < Content-Length: 1250 -36 < Content-Type: application/json -36 < Date: Tue, 20 Mar 2012 18:13:49 GMT -36 < X-Compute-Request-Id: req-0712676d-b227-40cd-8077-19bf2828566d -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:24 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 37 * LoggingFilter - Request received on thread pool-2-thread-1 -37 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -37 > Accept: application/json -37 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:25 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 38 * LoggingFilter - Response received on thread pool-2-thread-1 -38 < 200 -38 < Connection: keep-alive -38 < Content-Length: 1250 -38 < Content-Type: application/json -38 < Date: Tue, 20 Mar 2012 18:13:50 GMT -38 < X-Compute-Request-Id: req-1bc8efa3-cc28-47c5-9fd0-c763b0398a9a -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:25 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 39 * LoggingFilter - Request received on thread pool-2-thread-1 -39 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -39 > Accept: application/json -39 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:25 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 40 * LoggingFilter - Response received on thread pool-2-thread-1 -40 < 200 -40 < Connection: keep-alive -40 < Content-Length: 1250 -40 < Content-Type: application/json -40 < Date: Tue, 20 Mar 2012 18:13:51 GMT -40 < X-Compute-Request-Id: req-cb785ef5-7de3-4f5a-a656-0170dc476677 -{"server": {"OS-EXT-STS:task_state": "spawning", "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "building", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 0, "config_drive": "", "status": "BUILD", "updated": "2012-03-20T18:13:42Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -.Apr 2, 2012 5:07:26 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 41 * LoggingFilter - Request received on thread pool-2-thread-1 -41 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -41 > Accept: application/json -41 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:26 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 42 * LoggingFilter - Response received on thread pool-2-thread-1 -42 < 200 -42 < Connection: keep-alive -42 < Content-Length: 1243 -42 < Content-Type: application/json -42 < Date: Tue, 20 Mar 2012 18:13:52 GMT -42 < X-Compute-Request-Id: req-940d366e-a290-474e-af78-ce14dd5baed5 -{"server": {"OS-EXT-STS:task_state": null, "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "active", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "status": "ACTIVE", "updated": "2012-03-20T18:13:52Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}} - -Apr 2, 2012 5:07:26 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 43 * LoggingFilter - Request received on thread main -43 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/detail -43 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:27 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 44 * LoggingFilter - Response received on thread main -44 < 200 -44 < Connection: keep-alive -44 < Content-Length: 1246 -44 < Content-Type: application/json -44 < Date: Tue, 20 Mar 2012 18:13:52 GMT -44 < X-Compute-Request-Id: req-d7d54f95-2b83-48d0-bf2e-dfc349981350 -{"servers": [{"OS-EXT-STS:task_state": null, "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-EXT-STS:vm_state": "active", "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "OS-DCF:diskConfig": "MANUAL", "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "status": "ACTIVE", "updated": "2012-03-20T18:13:52Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "key_name": "", "name": "VGVpUeSzOk", "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "metadata": {}}]} - -Apr 2, 2012 5:07:27 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 45 * LoggingFilter - Request received on thread main -45 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf -45 > Accept: application/json -45 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:27 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 46 * LoggingFilter - Response received on thread main -46 < 200 -46 < Connection: keep-alive -46 < Content-Length: 803 -46 < Content-Type: application/json -46 < Date: Tue, 20 Mar 2012 18:13:53 GMT -46 < X-Compute-Request-Id: req-f999ebd3-5c27-4fb5-bcfe-b6625c132f39 -{"image": {"status": "ACTIVE", "updated": "2012-03-20T17:32:23Z", "name": "cirros-0.3.0-x86_64-uec", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:22Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "metadata": {"kernel_id": "c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "ramdisk_id": "8b1c8692-1817-4ecf-8a88-72b82266de93"}}} - -Apr 2, 2012 5:07:27 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 47 * LoggingFilter - Request received on thread main -47 > POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74/action -47 > Accept: application/json -47 > Content-Type: application/json -47 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 -{"pause":{}} - -Apr 2, 2012 5:07:27 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 48 * LoggingFilter - Response received on thread main -48 < 202 -48 < Connection: keep-alive -48 < Content-Length: 0 -48 < Content-Type: text/html; charset=UTF-8 -48 < Date: Tue, 20 Mar 2012 18:13:53 GMT - -Apr 2, 2012 5:07:30 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 49 * LoggingFilter - Request received on thread pool-3-thread-1 -49 > GET http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -49 > Accept: application/json -49 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:30 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 50 * LoggingFilter - Response received on thread pool-3-thread-1 -50 < 200 -50 < Connection: keep-alive -50 < Content-Length: 1228 -50 < Content-Type: application/json -50 < Date: Tue, 20 Mar 2012 18:13:56 GMT -50 < X-Compute-Request-Id: req-f192774c-069a-45e6-b1ee-1e2dfc97b875 -{"server": {"status": "PAUSED", "updated": "2012-03-20T18:13:54Z", "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", "user_id": "76e2570dadf2413ba0349ea9583b6b76", "name": "VGVpUeSzOk", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"}], "created": "2012-03-20T18:13:33Z", "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", "image": {"id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}]}, "OS-DCF:diskConfig": "MANUAL", "OS-EXT-STS:power_state": 3, "addresses": {"private": [{"version": 4, "addr": "10.0.0.2"}]}, "accessIPv4": "", "accessIPv6": "", "OS-EXT-STS:vm_state": "paused", "key_name": "", "OS-EXT-STS:task_state": null, "flavor": {"id": "1", "links": [{"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"}]}, "config_drive": "", "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", "metadata": {}}} - -Apr 2, 2012 5:07:30 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 51 * LoggingFilter - Request received on thread main -51 > POST http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74/action -51 > Accept: application/json -51 > Content-Type: application/json -51 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 -{"unpause":{}} - -Apr 2, 2012 5:07:30 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 52 * LoggingFilter - Response received on thread main -52 < 202 -52 < Connection: keep-alive -52 < Content-Length: 0 -52 < Content-Type: text/html; charset=UTF-8 -52 < Date: Tue, 20 Mar 2012 18:13:56 GMT - -Apr 2, 2012 5:07:30 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 53 * LoggingFilter - Request received on thread main -53 > DELETE http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74 -53 > X-Auth-Token: 55b7c585063f43cb8d21290b20f9e1b3 - -Apr 2, 2012 5:07:31 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 54 * LoggingFilter - Response received on thread main -54 < 409 -54 < Connection: keep-alive -54 < Content-Length: 104 -54 < Content-Type: application/json; charset=UTF-8 -54 < Date: Tue, 20 Mar 2012 18:13:56 GMT -54 < X-Compute-Request-Id: req-128be415-2756-4268-ad90-dc22bb50b621 -{"conflictingRequest": {"message": "Cannot 'delete' while instance is in vm_state paused", "code": 409}} \ No newline at end of file diff --git a/src/docbkx/flavors.json b/src/docbkx/flavors.json deleted file mode 100644 index ac6fbb84a..000000000 --- a/src/docbkx/flavors.json +++ /dev/null @@ -1,31 +0,0 @@ -{"flavors": [{"vcpus": 1, "disk": 0, "name": "m1.tiny", "links": - [{"href": - "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", - "rel": "self"}, {"href": - "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", - "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": - 0, "ram": 512, "id": "1", "swap": ""}, {"vcpus": 1, "disk": 10, "name": - "m1.small", "links": [{"href": - "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/2", - "rel": "self"}, {"href": - "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/2", - "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": - 20, "ram": 2048, "id": "2", "swap": ""}, {"vcpus": 2, "disk": 10, - "name": "m1.medium", "links": [{"href": - "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/3", - "rel": "self"}, {"href": - "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/3", - "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": - 40, "ram": 4096, "id": "3", "swap": ""}, {"vcpus": 4, "disk": 10, - "name": "m1.large", "links": [{"href": - "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/4", - "rel": "self"}, {"href": - "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/4", - "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": - 80, "ram": 8192, "id": "4", "swap": ""}, {"vcpus": 8, "disk": 10, - "name": "m1.xlarge", "links": [{"href": - "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/flavors/5", - "rel": "self"}, {"href": - "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/5", - "rel": "bookmark"}], "rxtx_factor": 1.0, "OS-FLV-EXT-DATA:ephemeral": - 160, "ram": 16384, "id": "5", "swap": ""}]} \ No newline at end of file diff --git a/src/docbkx/glance_all.txt b/src/docbkx/glance_all.txt deleted file mode 100644 index 3508ad86f..000000000 Binary files a/src/docbkx/glance_all.txt and /dev/null differ diff --git a/src/docbkx/identity-api.xml b/src/docbkx/identity-api.xml deleted file mode 100644 index 490d0ac3a..000000000 --- a/src/docbkx/identity-api.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Indentity API - - - - -
- Identity - - - -
-
\ No newline at end of file diff --git a/src/docbkx/images-api.xml b/src/docbkx/images-api.xml deleted file mode 100644 index f54c86f53..000000000 --- a/src/docbkx/images-api.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Images API - - - - -
- Images - - - -
-
\ No newline at end of file diff --git a/src/docbkx/images.json b/src/docbkx/images.json deleted file mode 100644 index ab1cda5a3..000000000 --- a/src/docbkx/images.json +++ /dev/null @@ -1 +0,0 @@ -{"images": [{"status": "ACTIVE", "updated": "2012-03-20T17:32:23Z", "name": "cirros-0.3.0-x86_64-uec", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:22Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", "metadata": {"kernel_id": "c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "ramdisk_id": "8b1c8692-1817-4ecf-8a88-72b82266de93"}}, {"status": "ACTIVE", "updated": "2012-03-20T17:32:22Z", "name": "cirros-0.3.0-x86_64-uec-ramdisk", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/8b1c8692-1817-4ecf-8a88-72b82266de93", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:22Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "8b1c8692-1817-4ecf-8a88-72b82266de93", "metadata": {}}, {"status": "ACTIVE", "updated": "2012-03-20T17:32:21Z", "name": "cirros-0.3.0-x86_64-uec-kernel", "links": [{"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "rel": "self"}, {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "rel": "bookmark"}, {"href": "http://192.168.1.52:9292/49ca8fb0aef0469996ca10eec7ff51a2/images/c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "type": "application/vnd.openstack.image", "rel": "alternate"}], "created": "2012-03-20T17:32:21Z", "progress": 100, "minRam": 0, "minDisk": 0, "id": "c9297f3d-0f27-496e-8ba6-9bb0c7a0df4c", "metadata": {}}]} \ No newline at end of file diff --git a/src/docbkx/index.xml b/src/docbkx/index.xml deleted file mode 100644 index 4ae195245..000000000 --- a/src/docbkx/index.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - OpenStack Java SDK - - Reference Documentation - - 1.0.0 - - - Luis Gervaso - - - - OpenStack Java SDK, 2012 - - - - - - - - - Preface - - - - Identity API (Keystone) - - - - - - Compute API (Nova) - - - - - - Images API (Glance) - - - - - - Storage API (Swift) - - - - - - \ No newline at end of file diff --git a/src/docbkx/keypairforcreate.json b/src/docbkx/keypairforcreate.json deleted file mode 100644 index f03d80a62..000000000 --- a/src/docbkx/keypairforcreate.json +++ /dev/null @@ -1 +0,0 @@ -{"keypair":{"name":"0NwvE"}} \ No newline at end of file diff --git a/src/docbkx/keystone_all.txt b/src/docbkx/keystone_all.txt deleted file mode 100644 index 666806583..000000000 --- a/src/docbkx/keystone_all.txt +++ /dev/null @@ -1,358 +0,0 @@ -Apr 2, 2012 5:02:34 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"admin","password":"secret0"},"tenantName":"admin"}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2550 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:09:00 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T18:09:00Z", "id": "ed3ca463e2c34fa88b211a7b41d84a2b", "tenant": {"enabled": true, "id": "37e752cd5382484ab0959eebdde11ba9", "name": "admin", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/37e752cd5382484ab0959eebdde11ba9", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/37e752cd5382484ab0959eebdde11ba9", "internalURL": "http://192.168.1.52:8774/v2/37e752cd5382484ab0959eebdde11ba9"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/37e752cd5382484ab0959eebdde11ba9", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/37e752cd5382484ab0959eebdde11ba9", "internalURL": "http://192.168.1.52:8776/v1/37e752cd5382484ab0959eebdde11ba9"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_37e752cd5382484ab0959eebdde11ba9", "internalURL": "http://192.168.1.52:8080/v1/AUTH_37e752cd5382484ab0959eebdde11ba9"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "admin", "roles_links": [], "id": "333fdcf99c3344a5ab744c227c1d3313", "roles": [{"id": "205ab7d0aabc4e0fa91323255a39734e", "name": "KeystoneAdmin"}, {"id": "adf90783f8e6470cbba2319fdf1eec91", "name": "admin"}, {"id": "eaca469f428c4c47ad484e3276a36735", "name": "KeystoneServiceAdmin"}], "name": "admin"}}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > GET http://192.168.1.52:35357/v2.0/endpoints -1 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 501 -2 < Connection: keep-alive -2 < Content-Length: 109 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:09:01 GMT -2 < Vary: X-Auth-Token -{"error": {"message": "The action you have requested has not been implemented.", "code": 501, "title": null}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 3 * LoggingFilter - Request received on thread main -3 > GET http://192.168.1.52:35357/v2.0/OS-KSADM/services -3 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 4 * LoggingFilter - Response received on thread main -4 < 200 -4 < Connection: keep-alive -4 < Content-Length: 25 -4 < Content-Type: application/json -4 < Date: Tue, 20 Mar 2012 18:09:01 GMT -4 < Vary: X-Auth-Token -{"OS-KSADM:services": []} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 5 * LoggingFilter - Request received on thread main -5 > GET http://192.168.1.52:35357/v2.0/tenants -5 > Accept: application/json -5 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 6 * LoggingFilter - Response received on thread main -6 < 200 -6 < Connection: keep-alive -6 < Content-Length: 444 -6 < Content-Type: application/json -6 < Date: Tue, 20 Mar 2012 18:09:01 GMT -6 < Vary: X-Auth-Token -{"tenants_links": [], "tenants": [{"enabled": true, "description": null, "name": "admin", "id": "37e752cd5382484ab0959eebdde11ba9"}, {"enabled": true, "description": null, "name": "service", "id": "ca52fbdb1b7e440c988229e3882f4349"}, {"enabled": true, "description": null, "name": "demo", "id": "49ca8fb0aef0469996ca10eec7ff51a2"}, {"enabled": true, "description": null, "name": "invisible_to_admin", "id": "a4aa0fc389b74c1fbe363d278db7f0e0"}]} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 7 * LoggingFilter - Request received on thread main -7 > GET http://192.168.1.52:35357/v2.0/users -7 > Accept: application/json -7 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 8 * LoggingFilter - Response received on thread main -8 < 200 -8 < Connection: keep-alive -8 < Content-Length: 729 -8 < Content-Type: application/json -8 < Date: Tue, 20 Mar 2012 18:09:01 GMT -8 < Vary: X-Auth-Token -{"users": [{"name": "admin", "enabled": true, "email": "admin@example.com", "id": "333fdcf99c3344a5ab744c227c1d3313", "tenantId": null}, {"name": "demo", "enabled": true, "email": "demo@example.com", "id": "76e2570dadf2413ba0349ea9583b6b76", "tenantId": null}, {"name": "nova", "enabled": true, "email": "nova@example.com", "id": "6cdcf686fcab422a897a57c9adca7409", "tenantId": "ca52fbdb1b7e440c988229e3882f4349"}, {"name": "glance", "enabled": true, "email": "glance@example.com", "id": "2ccf079bc75b4bc996b3a22ca92bbe54", "tenantId": "ca52fbdb1b7e440c988229e3882f4349"}, {"name": "swift", "enabled": true, "email": "swift@example.com", "id": "c967e47f1b7e433690b9f6acbb6fe433", "tenantId": "ca52fbdb1b7e440c988229e3882f4349"}]} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 9 * LoggingFilter - Request received on thread main -9 > GET http://192.168.1.52:35357/v2.0/OS-KSADM/roles -9 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 10 * LoggingFilter - Response received on thread main -10 < 200 -10 < Connection: keep-alive -10 < Content-Length: 415 -10 < Content-Type: application/json -10 < Date: Tue, 20 Mar 2012 18:09:01 GMT -10 < Vary: X-Auth-Token -{"roles": [{"id": "adf90783f8e6470cbba2319fdf1eec91", "name": "admin"}, {"id": "205ab7d0aabc4e0fa91323255a39734e", "name": "KeystoneAdmin"}, {"id": "eaca469f428c4c47ad484e3276a36735", "name": "KeystoneServiceAdmin"}, {"id": "fd9f96340215451cb5d7089ec091a9de", "name": "anotherrole"}, {"id": "31d8e7c333124a32a7ba5d117cd3d09a", "name": "Member"}, {"id": "3be10c92c59a49c6b802bb816f2e0306", "name": "ResellerAdmin"}]} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 11 * LoggingFilter - Request received on thread main -11 > POST http://192.168.1.52:35357/v2.0/tenants -11 > Accept: application/json -11 > Content-Type: application/json -11 > X-Auth-Token: secret0 -{"tenant":{"name":"test","enabled":true,"description":"desc"}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 12 * LoggingFilter - Response received on thread main -12 < 200 -12 < Connection: keep-alive -12 < Content-Length: 110 -12 < Content-Type: application/json -12 < Date: Tue, 20 Mar 2012 18:09:01 GMT -12 < Vary: X-Auth-Token -{"tenant": {"enabled": true, "description": "desc", "name": "test", "id": "e1feeac1bc29490eb57e7a16db41b2db"}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 13 * LoggingFilter - Request received on thread main -13 > POST http://192.168.1.52:35357/v2.0/users -13 > Accept: application/json -13 > Content-Type: application/json -13 > X-Auth-Token: secret0 -{"user":{"name":"test","password":"secret0","email":"test@test.com","enabled":true}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 14 * LoggingFilter - Response received on thread main -14 < 200 -14 < Connection: keep-alive -14 < Content-Length: 246 -14 < Content-Type: application/json -14 < Date: Tue, 20 Mar 2012 18:09:01 GMT -14 < Vary: X-Auth-Token -{"user": {"password": "$6$rounds=40000$Nx.NilmRxSlE1nnp$cUCG.zo3Fc.xYZRCbuuO1hCCGpOgvwywQ4RZRDGFS6NsrBOxOQKLkeyXYLxbvwLKFJEJiqOxTrDsy1U.TXxr30", "enabled": true, "email": "test@test.com", "name": "test", "id": "5f00e31c932f4b82904249940063c80e"}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 15 * LoggingFilter - Request received on thread main -15 > POST http://192.168.1.52:35357/v2.0/OS-KSADM/roles -15 > Content-Type: application/json -15 > X-Auth-Token: secret0 -{"role":{}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 16 * LoggingFilter - Response received on thread main -16 < 200 -16 < Connection: keep-alive -16 < Content-Length: 52 -16 < Content-Type: application/json -16 < Date: Tue, 20 Mar 2012 18:09:01 GMT -16 < Vary: X-Auth-Token -{"role": {"id": "1c74150ed0194a749bdc51bc8ce5b380"}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 17 * LoggingFilter - Request received on thread main -17 > POST http://192.168.1.52:35357/v2.0/OS-KSADM/services -17 > Content-Type: application/json -17 > X-Auth-Token: secret0 -{"OS-KSADM:service":{"name":"test","type":"compute","description":"Nova 3"}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 18 * LoggingFilter - Response received on thread main -18 < 200 -18 < Connection: keep-alive -18 < Content-Length: 124 -18 < Content-Type: application/json -18 < Date: Tue, 20 Mar 2012 18:09:01 GMT -18 < Vary: X-Auth-Token -{"OS-KSADM:service": {"id": "3df1b16a51d14a508a9dd2dce6614ebf", "type": "compute", "name": "test", "description": "Nova 3"}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 19 * LoggingFilter - Request received on thread main -19 > POST http://192.168.1.52:35357/v2.0/endpoints -19 > Content-Type: application/json -19 > X-Auth-Token: secret0 -{"endpoint":{"region":"RegionOne","service_id":"3df1b16a51d14a508a9dd2dce6614ebf","publicurl":"http://192.168.1.52:8774/v2/$(tenant_id)s","adminurl":"http://192.168.1.52:8774/v2/$(tenant_id)s","internalurl":"http://192.168.1.52:8774/v2/$(tenant_id)s"}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 20 * LoggingFilter - Response received on thread main -20 < 501 -20 < Connection: keep-alive -20 < Content-Length: 109 -20 < Content-Type: application/json -20 < Date: Tue, 20 Mar 2012 18:09:01 GMT -20 < Vary: X-Auth-Token -{"error": {"message": "The action you have requested has not been implemented.", "code": 501, "title": null}} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 21 * LoggingFilter - Request received on thread main -21 > GET http://192.168.1.52:35357/v2.0/tenants/e1feeac1bc29490eb57e7a16db41b2db/users -21 > Accept: application/json -21 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 22 * LoggingFilter - Response received on thread main -22 < 200 -22 < Connection: keep-alive -22 < Content-Length: 13 -22 < Content-Type: application/json -22 < Date: Tue, 20 Mar 2012 18:09:01 GMT -22 < Vary: X-Auth-Token -{"users": []} - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 23 * LoggingFilter - Request received on thread main -23 > GET http://192.168.1.52:35357/v2.0/OS-KSADM/roles/1c74150ed0194a749bdc51bc8ce5b380 -23 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 24 * LoggingFilter - Response received on thread main -24 < 200 -24 < Connection: keep-alive -24 < Content-Length: 66 -24 < Content-Type: application/json -24 < Date: Tue, 20 Mar 2012 18:09:01 GMT -24 < Vary: X-Auth-Token -{"role": {"id": "1c74150ed0194a749bdc51bc8ce5b380", "name": null}} - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 25 * LoggingFilter - Request received on thread main -25 > GET http://192.168.1.52:35357/v2.0/OS-KSADM/services/3df1b16a51d14a508a9dd2dce6614ebf -25 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 26 * LoggingFilter - Response received on thread main -26 < 200 -26 < Connection: keep-alive -26 < Content-Length: 124 -26 < Content-Type: application/json -26 < Date: Tue, 20 Mar 2012 18:09:01 GMT -26 < Vary: X-Auth-Token -{"OS-KSADM:service": {"description": "Nova 3", "type": "compute", "id": "3df1b16a51d14a508a9dd2dce6614ebf", "name": "test"}} - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 27 * LoggingFilter - Request received on thread main -27 > PUT http://192.168.1.52:35357/v2.0/users/5f00e31c932f4b82904249940063c80e -27 > Accept: application/json -27 > Content-Type: application/json -27 > X-Auth-Token: secret0 -{"user":{"id":"5f00e31c932f4b82904249940063c80e","name":"test","password":"$6$rounds=40000$Nx.NilmRxSlE1nnp$cUCG.zo3Fc.xYZRCbuuO1hCCGpOgvwywQ4RZRDGFS6NsrBOxOQKLkeyXYLxbvwLKFJEJiqOxTrDsy1U.TXxr30","email":"luis@woorea.es","enabled":true}} - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 28 * LoggingFilter - Response received on thread main -28 < 200 -28 < Connection: keep-alive -28 < Content-Length: 258 -28 < Content-Type: application/json -28 < Date: Tue, 20 Mar 2012 18:09:02 GMT -28 < Vary: X-Auth-Token -{"user": {"id": "5f00e31c932f4b82904249940063c80e", "name": "test", "extra": {"password": "$6$rounds=40000$Nx.NilmRxSlE1nnp$cUCG.zo3Fc.xYZRCbuuO1hCCGpOgvwywQ4RZRDGFS6NsrBOxOQKLkeyXYLxbvwLKFJEJiqOxTrDsy1U.TXxr30", "enabled": true, "email": "luis@woorea.es"}}} - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 29 * LoggingFilter - Request received on thread main -29 > PUT http://192.168.1.52:35357/v2.0/users/5f00e31c932f4b82904249940063c80e -29 > Accept: application/json -29 > Content-Type: application/json -29 > X-Auth-Token: secret0 -{"user":{"id":"5f00e31c932f4b82904249940063c80e","name":"test","enabled":false}} - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 30 * LoggingFilter - Response received on thread main -30 < 200 -30 < Connection: keep-alive -30 < Content-Length: 259 -30 < Content-Type: application/json -30 < Date: Tue, 20 Mar 2012 18:09:02 GMT -30 < Vary: X-Auth-Token -{"user": {"id": "5f00e31c932f4b82904249940063c80e", "name": "test", "extra": {"password": "$6$rounds=40000$Nx.NilmRxSlE1nnp$cUCG.zo3Fc.xYZRCbuuO1hCCGpOgvwywQ4RZRDGFS6NsrBOxOQKLkeyXYLxbvwLKFJEJiqOxTrDsy1U.TXxr30", "enabled": false, "email": "luis@woorea.es"}}} - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 31 * LoggingFilter - Request received on thread main -31 > PUT http://192.168.1.52:35357/v2.0/users/5f00e31c932f4b82904249940063c80e -31 > Accept: application/json -31 > Content-Type: application/json -31 > X-Auth-Token: secret0 -{"user":{"id":"5f00e31c932f4b82904249940063c80e","name":"test","password":"testing","enabled":false}} - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 32 * LoggingFilter - Response received on thread main -32 < 200 -32 < Connection: keep-alive -32 < Content-Length: 259 -32 < Content-Type: application/json -32 < Date: Tue, 20 Mar 2012 18:09:02 GMT -32 < Vary: X-Auth-Token -{"user": {"id": "5f00e31c932f4b82904249940063c80e", "name": "test", "extra": {"password": "$6$rounds=40000$tuT9C8QCvw8O4WHy$eM/UCaUO/TMDVoLuCr5vzlTJ6MWVJ4vYQhH2Qbimj19Qoc0rdF1dRqiiW8QACrNjNniSB5F5EHzBCgjWnk7KO1", "enabled": false, "email": "luis@woorea.es"}}} - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 33 * LoggingFilter - Request received on thread main -33 > DELETE http://192.168.1.52:35357/v2.0/OS-KSADM/services/ -33 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 34 * LoggingFilter - Response received on thread main -34 < 404 -34 < Connection: keep-alive -34 < Content-Length: 154 -34 < Content-Type: text/html; charset=UTF-8 -34 < Date: Tue, 20 Mar 2012 18:09:02 GMT - - - 404 Not Found - - -

404 Not Found

- The resource could not be found.

- - - - - - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 35 * LoggingFilter - Request received on thread main -35 > DELETE http://192.168.1.52:35357/v2.0/OS-KSADM/roles/ -35 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 36 * LoggingFilter - Response received on thread main -36 < 404 -36 < Connection: keep-alive -36 < Content-Length: 154 -36 < Content-Type: text/html; charset=UTF-8 -36 < Date: Tue, 20 Mar 2012 18:09:02 GMT - - - 404 Not Found - - -

404 Not Found

- The resource could not be found.

- - - - - - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 37 * LoggingFilter - Request received on thread main -37 > DELETE http://192.168.1.52:35357/v2.0/users/5f00e31c932f4b82904249940063c80e -37 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 38 * LoggingFilter - Response received on thread main -38 < 204 -38 < Connection: keep-alive -38 < Content-Type: application/json -38 < Date: Tue, 20 Mar 2012 18:09:02 GMT -38 < Transfer-Encoding: chunked -38 < Vary: X-Auth-Token - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 39 * LoggingFilter - Request received on thread main -39 > DELETE http://192.168.1.52:35357/v2.0/tenants/e1feeac1bc29490eb57e7a16db41b2db -39 > X-Auth-Token: secret0 - -Apr 2, 2012 5:02:36 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 40 * LoggingFilter - Response received on thread main -40 < 204 -40 < Connection: keep-alive -40 < Content-Type: application/json -40 < Date: Tue, 20 Mar 2012 18:09:02 GMT -40 < Transfer-Encoding: chunked -40 < Vary: X-Auth-Token \ No newline at end of file diff --git a/src/docbkx/keystone_public.txt b/src/docbkx/keystone_public.txt deleted file mode 100644 index 879821cac..000000000 --- a/src/docbkx/keystone_public.txt +++ /dev/null @@ -1,32 +0,0 @@ -Apr 2, 2012 5:03:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"demo","password":"secret0"},"tenantName":"demo"}} - -Apr 2, 2012 5:03:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2470 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:10:01 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T18:10:01Z", "id": "41a8bc56c38f4d538c36350b358a110f", "tenant": {"enabled": true, "id": "49ca8fb0aef0469996ca10eec7ff51a2", "name": "demo", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8776/v1/49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2", "internalURL": "http://192.168.1.52:8080/v1/AUTH_49ca8fb0aef0469996ca10eec7ff51a2"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "76e2570dadf2413ba0349ea9583b6b76", "roles": [{"id": "fd9f96340215451cb5d7089ec091a9de", "name": "anotherrole"}, {"id": "31d8e7c333124a32a7ba5d117cd3d09a", "name": "Member"}], "name": "demo"}}} - -Apr 2, 2012 5:03:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > GET http://192.168.1.52:5000/v2.0/tenants -1 > Accept: application/json -1 > X-Auth-Token: 41a8bc56c38f4d538c36350b358a110f - -Apr 2, 2012 5:03:35 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 244 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:10:01 GMT -2 < Vary: X-Auth-Token -{"tenants_links": [], "tenants": [{"enabled": true, "description": null, "name": "demo", "id": "49ca8fb0aef0469996ca10eec7ff51a2"}, {"enabled": true, "description": null, "name": "invisible_to_admin", "id": "a4aa0fc389b74c1fbe363d278db7f0e0"}]} \ No newline at end of file diff --git a/src/docbkx/keystone_user_role_tenant.txt b/src/docbkx/keystone_user_role_tenant.txt deleted file mode 100644 index bcaf8eb06..000000000 --- a/src/docbkx/keystone_user_role_tenant.txt +++ /dev/null @@ -1,141 +0,0 @@ -Apr 2, 2012 5:04:59 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"admin","password":"secret0"},"tenantName":"admin"}} - -Apr 2, 2012 5:04:59 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2550 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:11:25 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T18:11:25Z", "id": "f54da169862c40e5a23a0d6d5b79bc90", "tenant": {"enabled": true, "id": "37e752cd5382484ab0959eebdde11ba9", "name": "admin", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/37e752cd5382484ab0959eebdde11ba9", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/37e752cd5382484ab0959eebdde11ba9", "internalURL": "http://192.168.1.52:8774/v2/37e752cd5382484ab0959eebdde11ba9"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/37e752cd5382484ab0959eebdde11ba9", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/37e752cd5382484ab0959eebdde11ba9", "internalURL": "http://192.168.1.52:8776/v1/37e752cd5382484ab0959eebdde11ba9"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_37e752cd5382484ab0959eebdde11ba9", "internalURL": "http://192.168.1.52:8080/v1/AUTH_37e752cd5382484ab0959eebdde11ba9"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "admin", "roles_links": [], "id": "333fdcf99c3344a5ab744c227c1d3313", "roles": [{"id": "205ab7d0aabc4e0fa91323255a39734e", "name": "KeystoneAdmin"}, {"id": "adf90783f8e6470cbba2319fdf1eec91", "name": "admin"}, {"id": "eaca469f428c4c47ad484e3276a36735", "name": "KeystoneServiceAdmin"}], "name": "admin"}}} - -Apr 2, 2012 5:04:59 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:35357/v2.0/tenants -1 > Accept: application/json -1 > Content-Type: application/json -1 > X-Auth-Token: secret0 -{"tenant":{"name":"test5","enabled":true,"description":"desc"}} - -Apr 2, 2012 5:04:59 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 111 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 18:11:25 GMT -2 < Vary: X-Auth-Token -{"tenant": {"enabled": true, "description": "desc", "name": "test5", "id": "c226c0ee354844ad953ecc0077f6dd18"}} - -Apr 2, 2012 5:04:59 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 3 * LoggingFilter - Request received on thread main -3 > POST http://192.168.1.52:35357/v2.0/users -3 > Accept: application/json -3 > Content-Type: application/json -3 > X-Auth-Token: secret0 -{"user":{"name":"test5","password":"secret0","email":"test@test.com","enabled":true}} - -Apr 2, 2012 5:04:59 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 4 * LoggingFilter - Response received on thread main -4 < 200 -4 < Connection: keep-alive -4 < Content-Length: 247 -4 < Content-Type: application/json -4 < Date: Tue, 20 Mar 2012 18:11:25 GMT -4 < Vary: X-Auth-Token -{"user": {"password": "$6$rounds=40000$lKt/WaTRLLcknXEi$22U/ZN693T6.DafNmDK0l4WsySRES0fHThcMLYm/HU1yPNXDd5projbQPaMo9WtMqoa9gqR.t4G1pjI1UNF2p.", "enabled": true, "email": "test@test.com", "name": "test5", "id": "18992c7859d04988bd79dcd791aaedfc"}} - -Apr 2, 2012 5:04:59 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 5 * LoggingFilter - Request received on thread main -5 > POST http://192.168.1.52:35357/v2.0/OS-KSADM/roles -5 > Content-Type: application/json -5 > X-Auth-Token: secret0 -{"role":{"name":"test5"}} - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 6 * LoggingFilter - Response received on thread main -6 < 200 -6 < Connection: keep-alive -6 < Content-Length: 69 -6 < Content-Type: application/json -6 < Date: Tue, 20 Mar 2012 18:11:25 GMT -6 < Vary: X-Auth-Token -{"role": {"name": "test5", "id": "a5609efc078f4c86b4a32233f98cb4ef"}} - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 7 * LoggingFilter - Request received on thread main -7 > PUT http://192.168.1.52:35357/v2.0/tenants/c226c0ee354844ad953ecc0077f6dd18/users/18992c7859d04988bd79dcd791aaedfc/roles/OS-KSADM/a5609efc078f4c86b4a32233f98cb4ef -7 > Accept: application/json -7 > X-Auth-Token: secret0 - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 8 * LoggingFilter - Response received on thread main -8 < 200 -8 < Connection: keep-alive -8 < Content-Length: 69 -8 < Content-Type: application/json -8 < Date: Tue, 20 Mar 2012 18:11:26 GMT -8 < Vary: X-Auth-Token -{"role": {"id": "a5609efc078f4c86b4a32233f98cb4ef", "name": "test5"}} - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 9 * LoggingFilter - Request received on thread main -9 > DELETE http://192.168.1.52:35357/v2.0/tenants/c226c0ee354844ad953ecc0077f6dd18/users/18992c7859d04988bd79dcd791aaedfc/roles/OS-KSADM/a5609efc078f4c86b4a32233f98cb4ef -9 > X-Auth-Token: secret0 - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 10 * LoggingFilter - Response received on thread main -10 < 204 -10 < Connection: keep-alive -10 < Content-Type: application/json -10 < Date: Tue, 20 Mar 2012 18:11:26 GMT -10 < Transfer-Encoding: chunked -10 < Vary: X-Auth-Token - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 11 * LoggingFilter - Request received on thread main -11 > DELETE http://192.168.1.52:35357/v2.0/OS-KSADM/roles/a5609efc078f4c86b4a32233f98cb4ef -11 > X-Auth-Token: secret0 - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 12 * LoggingFilter - Response received on thread main -12 < 204 -12 < Connection: keep-alive -12 < Content-Type: application/json -12 < Date: Tue, 20 Mar 2012 18:11:26 GMT -12 < Transfer-Encoding: chunked -12 < Vary: X-Auth-Token - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 13 * LoggingFilter - Request received on thread main -13 > DELETE http://192.168.1.52:35357/v2.0/users/18992c7859d04988bd79dcd791aaedfc -13 > X-Auth-Token: secret0 - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 14 * LoggingFilter - Response received on thread main -14 < 204 -14 < Connection: keep-alive -14 < Content-Type: application/json -14 < Date: Tue, 20 Mar 2012 18:11:26 GMT -14 < Transfer-Encoding: chunked -14 < Vary: X-Auth-Token - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 15 * LoggingFilter - Request received on thread main -15 > DELETE http://192.168.1.52:35357/v2.0/tenants/c226c0ee354844ad953ecc0077f6dd18 -15 > X-Auth-Token: secret0 - -Apr 2, 2012 5:05:00 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 16 * LoggingFilter - Response received on thread main -16 < 204 -16 < Connection: keep-alive -16 < Content-Type: application/json -16 < Date: Tue, 20 Mar 2012 18:11:26 GMT -16 < Transfer-Encoding: chunked -16 < Vary: X-Auth-Token \ No newline at end of file diff --git a/src/docbkx/server.created.json b/src/docbkx/server.created.json deleted file mode 100644 index 1e136287e..000000000 --- a/src/docbkx/server.created.json +++ /dev/null @@ -1,12 +0,0 @@ -{"server": { - "OS-DCF:diskConfig": "MANUAL", - "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", - "links": [{ - "href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", - "rel": "self" - }, { - "href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", - "rel": "bookmark" - }], - "adminPass": "8koc7wb4WtFD" - }} \ No newline at end of file diff --git a/src/docbkx/server.json b/src/docbkx/server.json deleted file mode 100644 index d4979f2fd..000000000 --- a/src/docbkx/server.json +++ /dev/null @@ -1,39 +0,0 @@ -{"server": { - "OS-EXT-STS:task_state": null, - "addresses": { - "private": [{"version": 4, "addr": "10.0.0.2"}] - }, - "links": [ - {"href": "http://192.168.1.52:8774/v2/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "self"}, - {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/servers/af7b93fe-3262-446a-8f19-b5b637d67b74", "rel": "bookmark"} - ], - "image": { - "id": "d00e8cef-a05f-4d53-bace-0289b43c15bf", - "links": [ - {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/images/d00e8cef-a05f-4d53-bace-0289b43c15bf", "rel": "bookmark"} - ] - }, - "OS-EXT-STS:vm_state": "active", - "flavor": { - "id": "1", - "links": [ - {"href": "http://192.168.1.52:8774/49ca8fb0aef0469996ca10eec7ff51a2/flavors/1", "rel": "bookmark"} - ] - }, - "id": "af7b93fe-3262-446a-8f19-b5b637d67b74", - "user_id": "76e2570dadf2413ba0349ea9583b6b76", - "OS-DCF:diskConfig": "MANUAL", - "accessIPv4": "", - "accessIPv6": "", - "progress": 0, - "OS-EXT-STS:power_state": 1, - "config_drive": "", - "status": "ACTIVE", - "updated": "2012-03-20T18:13:52Z", - "hostId": "d9f670be93015ca363c5a40b6db902102db46d2c7240f6dd7346028d", - "key_name": "", - "name": "VGVpUeSzOk", - "created": "2012-03-20T18:13:33Z", - "tenant_id": "49ca8fb0aef0469996ca10eec7ff51a2", - "metadata": {} - }} \ No newline at end of file diff --git a/src/docbkx/serverforcreate.json b/src/docbkx/serverforcreate.json deleted file mode 100644 index b09ffbd0b..000000000 --- a/src/docbkx/serverforcreate.json +++ /dev/null @@ -1,6 +0,0 @@ -{"server":{ - "name":"VGVpUeSzOk", - "imageRef":"d00e8cef-a05f-4d53-bace-0289b43c15bf", - "flavorRef":"1", - "configDrive":false - }} \ No newline at end of file diff --git a/src/docbkx/storage-api.xml b/src/docbkx/storage-api.xml deleted file mode 100644 index 02238ec99..000000000 --- a/src/docbkx/storage-api.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - Storage API - - - - -
- Account - - - -
-
- Container - - - -
-
- Objects - - - -
-
\ No newline at end of file diff --git a/src/docbkx/styles/fop-cust.xsl b/src/docbkx/styles/fop-cust.xsl deleted file mode 100644 index df5a357a4..000000000 --- a/src/docbkx/styles/fop-cust.xsl +++ /dev/null @@ -1,686 +0,0 @@ - - - - - - -]> - - - - - - - - - - - - 1 - - - 0 - - - - - 1 - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - Version - - - - - - - - - - - - - - - Copyright ©right; 2004-2007 - - - , - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Helvetica - 9pt - - - - - - - - - - - - - - - - - - - - - Blank - - - - Contents - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Helvetica - 9pt - - - - - - - - - - - ( - - ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bold - - - - - - - - - - - - - - - - - - - - - - - - - - - - - book toc - - - - - 3 - - - - - - - - - bold - normal - - - - - - - - - - - 1 - - - 0 - - - 0 - - - - - 5mm - - - 10mm - - - 10mm - - - - 15mm - - - 10mm - - - 5mm - - - - 18mm - - - 18mm - - - - - 0pc - - - - - - - justify - - - true - - - - - Times-Roman - - - 10 - - - 9 - - - - - 1.3 - - - - - - - - 0.9em - - - - opt - - - - - - - - - - 6pt - 6pt - 3pt - 2pt - - - - - 0.2pt - - - 0.2pt - - - - - - - 1 - - - - - - - - - left - bold - - - pt - - - - - - - - - - - - - 0.8em - 0.8em - 0.8em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.6em - 0.6em - 0.6em - - - pt - - 0.1em - 0.1em - 0.1em - - - 0.4em - 0.4em - 0.4em - - - pt - - 0.1em - 0.1em - 0.1em - - - - - - - bold - - - pt - - false - 0.4em - 0.6em - 0.8em - - - - - - - - - - - - - - - - - pt - - - - - 1em - 1em - 1em - - - - - - - - - - - - - - - - - - 0 - - - 1 - - - - - 90 - - - - - - - '1' - - &admon_gfx_path; - - - - - - - figure after - example before - equation before - table before - procedure before - - - - - 0 - - - 0 - - - , - - - - - 0.1em - 0.1em - 0.1em - 0.1em - 0.1em - 0.1em - - - - 0.3em - 0.2em - 0.8em - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/docbkx/styles/screen.css b/src/docbkx/styles/screen.css deleted file mode 100644 index f1b21644a..000000000 --- a/src/docbkx/styles/screen.css +++ /dev/null @@ -1,303 +0,0 @@ -body { - text-align: justify; - margin-right: 2em; - margin-left: 2em; -} - -a, -a[accesskey^="h"], -a[accesskey^="n"], -a[accesskey^="u"], -a[accesskey^="p"] { - font-family: Verdana, Arial, helvetica, sans-serif; - font-size: 12px; - color: #003399; -} - -a:active { - color: #003399; -} - -a:visited { - color: #888888; -} - -p { - font-family: Verdana, Arial, sans-serif; -} - -dt { - font-family: Verdana, Arial, sans-serif; - font-size: 12px; -} - -p, dl, dt, dd, blockquote { - color: #000000; - margin-bottom: 3px; - margin-top: 3px; - padding-top: 0; -} - -ol, ul, p { - margin-top: 6px; - margin-bottom: 6px; -} - -p, blockquote { - font-size: 90%; -} - -p.releaseinfo { - font-size: 100%; - font-weight: bold; - font-family: Verdana, Arial, helvetica, sans-serif; - padding-top: 10px; -} - -p.pubdate { - font-size: 120%; - font-weight: bold; - font-family: Verdana, Arial, helvetica, sans-serif; -} - -td { - font-size: 80%; -} - -td, th, span { - color: #000000; -} - -td[width^="40%"] { - font-family: Verdana, Arial, helvetica, sans-serif; - font-size: 12px; - color: #003399; -} - -table[summary^="Navigation header"] tbody tr th[colspan^="3"] { - font-family: Verdana, Arial, helvetica, sans-serif; -} - -blockquote { - margin-right: 0; -} - -h1, h2, h3, h4, h6 { - color: #000000; - font-weight: 500; - margin-top: 0; - padding-top: 14px; - font-family: Verdana, Arial, helvetica, sans-serif; - margin-bottom: 0; -} - -h2.title { - font-weight: 800; - margin-bottom: 8px; -} - -h2.subtitle { - font-weight: 800; - margin-bottom: 20px; -} - -.firstname, .surname { - font-size: 12px; - font-family: Verdana, Arial, helvetica, sans-serif; -} - -table { - border-collapse: collapse; - border-spacing: 0; - border: 1px black; - empty-cells: hide; - margin: 10px 0 30px 50px; - width: 90%; -} - -div.table { - margin: 30px 0 10px 0; - border: 1px dashed gray; - padding: 10px; -} - -div .table-contents table { - border: 1px solid black; -} - -div.table > p.title { - padding-left: 10px; -} - -table[summary^="Navigation footer"] { - border-collapse: collapse; - border-spacing: 0; - border: 1px black; - empty-cells: hide; - margin: 0px; - width: 100%; -} - -table[summary^="Note"], -table[summary^="Warning"], -table[summary^="Tip"] { - border-collapse: collapse; - border-spacing: 0; - border: 1px black; - empty-cells: hide; - margin: 10px 0px 10px -20px; - width: 100%; -} - -td { - padding: 4pt; - font-family: Verdana, Arial, helvetica, sans-serif; -} - -div.warning TD { - text-align: justify; -} - -h1 { - font-size: 150%; -} - -h2 { - font-size: 110%; -} - -h3 { - font-size: 100%; font-weight: bold; -} - -h4 { - font-size: 90%; font-weight: bold; -} - -h5 { - font-size: 90%; font-style: italic; -} - -h6 { - font-size: 100%; font-style: italic; -} - -tt { - font-size: 110%; - font-family: "Courier New", Courier, monospace; - color: #000000; -} - -.navheader, .navfooter { - border: none; -} - -div.navfooter table { - border-style: dashed; - border-color: gray; - border-width: 1px 1px 1px 1px; - background-color: #cde48d; -} - -pre { - font-size: 110%; - padding: 5px; - border-style: solid; - border-width: 1px; - border-color: #CCCCCC; - background-color: #f3f5e9; -} - -ul, ol, li { - list-style: disc; -} - -hr { - width: 100%; - height: 1px; - background-color: #CCCCCC; - border-width: 0; - padding: 0; -} - -.variablelist { - padding-top: 10px; - padding-bottom: 10px; - margin: 0; -} - -.term { - font-weight:bold; -} - -.mediaobject { - padding-top: 30px; - padding-bottom: 30px; -} - -.legalnotice { - font-family: Verdana, Arial, helvetica, sans-serif; - font-size: 12px; - font-style: italic; -} - -.sidebar { - float: right; - margin: 10px 0 10px 30px; - padding: 10px 20px 20px 20px; - width: 33%; - border: 1px solid black; - background-color: #F4F4F4; - font-size: 14px; -} - -.property { - font-family: "Courier New", Courier, monospace; -} - -a code { - font-family: Verdana, Arial, monospace; - font-size: 12px; -} - -td code { - font-size: 110%; -} - -div.note * td, -div.tip * td, -div.warning * td, -div.calloutlist * td { - text-align: justify; - font-size: 100%; -} - -.programlisting { - clear: both; -} - -.programlisting .interfacename, -.programlisting .literal, -.programlisting .classname { - font-size: 95%; -} - -.title .interfacename, -.title .literal, -.title .classname { - font-size: 130%; -} - -/* everything in a is displayed in a coloured, comment-like font */ -.programlisting * .lineannotation, -.programlisting * .lineannotation * { - color: green; -} - -.question * p { - font-size: 100%; -} - -.answer * p { - font-size: 100%; -} diff --git a/src/docbkx/volumes.txt b/src/docbkx/volumes.txt deleted file mode 100644 index 8a84d943e..000000000 --- a/src/docbkx/volumes.txt +++ /dev/null @@ -1,211 +0,0 @@ -Apr 2, 2012 3:53:13 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > POST http://192.168.1.52:5000/v2.0/tokens -1 > Accept: application/json -1 > Content-Type: application/json -{"auth":{"passwordCredentials":{"username":"demo","password":"secret0"},"tenantName":"demo"}} - -Apr 2, 2012 3:53:13 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 2470 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 17:51:13 GMT -2 < Vary: X-Auth-Token -{"access": {"token": {"expires": "2012-03-21T17:51:13Z", "id": "5fe0d3add307482cb5781b39619c912d", "tenant": {"enabled": true, "id": "ed9c8b3b0853427ab0c58893a8a274b9", "name": "demo", "description": null}}, "serviceCatalog": [{"endpoints": [{"adminURL": "http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9", "region": "RegionOne", "publicURL": "http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9", "internalURL": "http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9"}], "endpoints_links": [], "type": "compute", "name": "Compute Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080", "internalURL": "http://192.168.1.52:8080"}], "endpoints_links": [], "type": "s3", "name": "S3 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:9292/v1", "region": "RegionOne", "publicURL": "http://192.168.1.52:9292/v1", "internalURL": "http://192.168.1.52:9292/v1"}], "endpoints_links": [], "type": "image", "name": "Image Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8776/v1/ed9c8b3b0853427ab0c58893a8a274b9", "region": "RegionOne", "publicURL": "http://192.168.1.52:8776/v1/ed9c8b3b0853427ab0c58893a8a274b9", "internalURL": "http://192.168.1.52:8776/v1/ed9c8b3b0853427ab0c58893a8a274b9"}], "endpoints_links": [], "type": "volume", "name": "Volume Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8773/services/Admin", "region": "RegionOne", "publicURL": "http://192.168.1.52:8773/services/Cloud", "internalURL": "http://192.168.1.52:8773/services/Cloud"}], "endpoints_links": [], "type": "ec2", "name": "EC2 Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:8080/", "region": "RegionOne", "publicURL": "http://192.168.1.52:8080/v1/AUTH_ed9c8b3b0853427ab0c58893a8a274b9", "internalURL": "http://192.168.1.52:8080/v1/AUTH_ed9c8b3b0853427ab0c58893a8a274b9"}], "endpoints_links": [], "type": "object-store", "name": "Swift Service"}, {"endpoints": [{"adminURL": "http://192.168.1.52:35357/v2.0", "region": "RegionOne", "publicURL": "http://192.168.1.52:5000/v2.0", "internalURL": "http://192.168.1.52:5000/v2.0"}], "endpoints_links": [], "type": "identity", "name": "Identity Service"}], "user": {"username": "demo", "roles_links": [], "id": "0d349a392fd8478ca1a87c6208c9914f", "roles": [{"id": "adcea98694694849bc793951a19a2eb4", "name": "anotherrole"}, {"id": "713ec3ef73d84ac99c8f5b131c84bc60", "name": "Member"}], "name": "demo"}}} - -Apr 2, 2012 3:53:13 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 1 * LoggingFilter - Request received on thread main -1 > GET http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-volumes -1 > Accept: application/json -1 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 2 * LoggingFilter - Response received on thread main -2 < 200 -2 < Connection: keep-alive -2 < Content-Length: 15 -2 < Content-Type: application/json -2 < Date: Tue, 20 Mar 2012 17:51:14 GMT -2 < X-Compute-Request-Id: req-5bacc90f-c6be-4785-ac6c-53b441f9ac72 -{"volumes": []} - -Apr 2, 2012 3:53:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 3 * LoggingFilter - Request received on thread main -3 > GET http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-snapshots -3 > Accept: application/json -3 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 4 * LoggingFilter - Response received on thread main -4 < 200 -4 < Connection: keep-alive -4 < Content-Length: 17 -4 < Content-Type: application/json -4 < Date: Tue, 20 Mar 2012 17:51:14 GMT -4 < X-Compute-Request-Id: req-cd72a271-5d3a-41f6-89ae-693f7bbde261 -{"snapshots": []} - -Apr 2, 2012 3:53:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 5 * LoggingFilter - Request received on thread main -5 > POST http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-volumes -5 > Accept: application/json -5 > Content-Type: application/json -5 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d -{"volume":{"size":1,"display_name":"v2"}} - -Apr 2, 2012 3:53:14 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 6 * LoggingFilter - Response received on thread main -6 < 200 -6 < Connection: keep-alive -6 < Content-Length: 251 -6 < Content-Type: application/json -6 < Date: Tue, 20 Mar 2012 17:51:14 GMT -6 < X-Compute-Request-Id: req-018507d8-af9d-4dde-a5a6-0614a255105c -{"volume": {"status": "creating", "displayDescription": null, "availabilityZone": "nova", "displayName": "v2", "attachments": [{}], "volumeType": null, "snapshotId": null, "size": 1, "id": 1, "createdAt": "2012-03-20 17:51:14.900875", "metadata": {}}} - -Volume [id=1, status=creating, sizeInGB=1, availabilityZone=nova, type=null, created=null, name=v2, description=null, snapshotId=null, metadata=org.openstack.model.compute.nova.NovaMetadata@290e1513] -Apr 2, 2012 3:53:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 7 * LoggingFilter - Request received on thread pool-2-thread-1 -7 > GET http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-volumes/1 -7 > Accept: application/json -7 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 8 * LoggingFilter - Response received on thread pool-2-thread-1 -8 < 200 -8 < Connection: keep-alive -8 < Content-Length: 245 -8 < Content-Type: application/json -8 < Date: Tue, 20 Mar 2012 17:51:18 GMT -8 < X-Compute-Request-Id: req-4de2ad3b-d150-4d89-be7c-dcd336c46241 -{"volume": {"status": "available", "displayDescription": null, "availabilityZone": "nova", "displayName": "v2", "attachments": [{}], "volumeType": null, "snapshotId": null, "size": 1, "id": 1, "createdAt": "2012-03-20 17:51:14", "metadata": {}}} - -Apr 2, 2012 3:53:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 9 * LoggingFilter - Request received on thread main -9 > POST http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-snapshots -9 > Accept: application/json -9 > Content-Type: application/json -9 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d -{"snapshot":{"volume_id":1,"display_name":"v2","display_description":"desc"}} - -Apr 2, 2012 3:53:17 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 10 * LoggingFilter - Response received on thread main -10 < 200 -10 < Connection: keep-alive -10 < Content-Length: 165 -10 < Content-Type: application/json -10 < Date: Tue, 20 Mar 2012 17:51:18 GMT -10 < X-Compute-Request-Id: req-7c1c0898-1f29-4723-bf39-e2fbfd82427e -{"snapshot": {"status": "creating", "displayDescription": "desc", "displayName": "v2", "volumeId": 1, "id": 1, "createdAt": "2012-03-20 17:51:18.227946", "size": 1}} - -Apr 2, 2012 3:53:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 11 * LoggingFilter - Request received on thread pool-3-thread-1 -11 > GET http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-snapshots/1 -11 > Accept: application/json -11 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 12 * LoggingFilter - Response received on thread pool-3-thread-1 -12 < 200 -12 < Connection: keep-alive -12 < Content-Length: 159 -12 < Content-Type: application/json -12 < Date: Tue, 20 Mar 2012 17:51:21 GMT -12 < X-Compute-Request-Id: req-76d7b8e3-6d5b-4441-bd14-0f2f4ddbce21 -{"snapshot": {"status": "available", "displayDescription": "desc", "displayName": "v2", "volumeId": 1, "id": 1, "createdAt": "2012-03-20 17:51:18", "size": 1}} - -Apr 2, 2012 3:53:20 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 13 * LoggingFilter - Request received on thread main -13 > GET http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-volumes -13 > Accept: application/json -13 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 14 * LoggingFilter - Response received on thread main -14 < 200 -14 < Connection: keep-alive -14 < Content-Length: 248 -14 < Content-Type: application/json -14 < Date: Tue, 20 Mar 2012 17:51:21 GMT -14 < X-Compute-Request-Id: req-b53e0021-6e17-4d94-8c5d-1dbadaa3f46e -{"volumes": [{"status": "available", "displayDescription": null, "availabilityZone": "nova", "displayName": "v2", "attachments": [{}], "volumeType": null, "snapshotId": null, "size": 1, "id": 1, "createdAt": "2012-03-20 17:51:14", "metadata": {}}]} - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 15 * LoggingFilter - Request received on thread main -15 > GET http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-volumes/1 -15 > Accept: application/json -15 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 16 * LoggingFilter - Response received on thread main -16 < 200 -16 < Connection: keep-alive -16 < Content-Length: 245 -16 < Content-Type: application/json -16 < Date: Tue, 20 Mar 2012 17:51:21 GMT -16 < X-Compute-Request-Id: req-8060c2a0-4ee7-4e68-8ce6-df5dd73f855c -{"volume": {"status": "available", "displayDescription": null, "availabilityZone": "nova", "displayName": "v2", "attachments": [{}], "volumeType": null, "snapshotId": null, "size": 1, "id": 1, "createdAt": "2012-03-20 17:51:14", "metadata": {}}} - -Volume [id=1, status=available, sizeInGB=1, availabilityZone=nova, type=null, created=null, name=v2, description=null, snapshotId=null, metadata=org.openstack.model.compute.nova.NovaMetadata@2bab5dae] -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 17 * LoggingFilter - Request received on thread main -17 > GET http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-snapshots -17 > Accept: application/json -17 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 18 * LoggingFilter - Response received on thread main -18 < 200 -18 < Connection: keep-alive -18 < Content-Length: 162 -18 < Content-Type: application/json -18 < Date: Tue, 20 Mar 2012 17:51:21 GMT -18 < X-Compute-Request-Id: req-924ae458-6d53-429c-beef-27b7c4ec0642 -{"snapshots": [{"status": "available", "displayDescription": "desc", "displayName": "v2", "volumeId": 1, "id": 1, "createdAt": "2012-03-20 17:51:18", "size": 1}]} - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 19 * LoggingFilter - Request received on thread main -19 > GET http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-snapshots/1 -19 > Accept: application/json -19 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -NovaSnapshot [id=1, status=available, sizeInGB=1, availabilityZone=null, created=2012-03-20 17:51:18, name=v2, description=desc, volumeId=1] -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 20 * LoggingFilter - Response received on thread main -20 < 200 -20 < Connection: keep-alive -20 < Content-Length: 159 -20 < Content-Type: application/json -20 < Date: Tue, 20 Mar 2012 17:51:21 GMT -20 < X-Compute-Request-Id: req-ea181b89-1a1c-47a1-9d09-884a6d7add95 -{"snapshot": {"status": "available", "displayDescription": "desc", "displayName": "v2", "volumeId": 1, "id": 1, "createdAt": "2012-03-20 17:51:18", "size": 1}} - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 21 * LoggingFilter - Request received on thread main -21 > DELETE http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-snapshots/1 -21 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 22 * LoggingFilter - Response received on thread main -22 < 202 -22 < Connection: keep-alive -22 < Content-Length: 0 -22 < Content-Type: text/html; charset=UTF-8 -22 < Date: Tue, 20 Mar 2012 17:51:21 GMT - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 23 * LoggingFilter - Request received on thread main -23 > DELETE http://192.168.1.52:8774/v2/ed9c8b3b0853427ab0c58893a8a274b9/os-volumes/1 -23 > X-Auth-Token: 5fe0d3add307482cb5781b39619c912d - -Apr 2, 2012 3:53:21 AM org.glassfish.jersey.filter.LoggingFilter log -INFO: 24 * LoggingFilter - Response received on thread main -24 < 400 -24 < Connection: keep-alive -24 < Content-Length: 98 -24 < Content-Type: application/json; charset=UTF-8 -24 < Date: Tue, 20 Mar 2012 17:51:21 GMT -24 < X-Compute-Request-Id: req-475b822f-2567-4185-98ce-800038ff6532 -{"badRequest": {"message": "Invalid volume: Volume still has 1 dependent snapshots", "code": 400}} \ No newline at end of file diff --git a/src/main/java/org/glassfish/jersey/client/HttpUrlConnector.java b/src/main/java/org/glassfish/jersey/client/HttpUrlConnector.java deleted file mode 100644 index 83f303459..000000000 --- a/src/main/java/org/glassfish/jersey/client/HttpUrlConnector.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright (c) 2011-2012 Oracle and/or its affiliates. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common Development - * and Distribution License("CDDL") (collectively, the "License"). You - * may not use this file except in compliance with the License. You can - * obtain a copy of the License at - * http://glassfish.java.net/public/CDDL+GPL_1_1.html - * or packager/legal/LICENSE.txt. See the License for the specific - * language governing permissions and limitations under the License. - * - * When distributing the software, include this License Header Notice in each - * file and include the License file at packager/legal/LICENSE.txt. - * - * GPL Classpath Exception: - * Oracle designates this particular file as subject to the "Classpath" - * exception as provided by Oracle in the GPL Version 2 section of the License - * file that accompanied this code. - * - * Modifications: - * If applicable, add the following below the License Header, with the fields - * enclosed by brackets [] replaced by your own identifying information: - * "Portions Copyright [year] [name of copyright owner]" - * - * Contributor(s): - * If you wish your version of this file to be governed by only the CDDL or - * only the GPL Version 2, indicate your decision by adding "[Contributor] - * elects to include this software in this distribution under the [CDDL or GPL - * Version 2] license." If you don't indicate a single choice of license, a - * recipient has the option to distribute your version of this file under - * either the CDDL, the GPL Version 2 or to extend the choice of license to - * its licensees as provided above. However, if you add GPL Version 2 code - * and therefore, elected the GPL Version 2 license, then the option applies - * only if the new code is made subject to such option by the copyright - * holder. - */ -package org.glassfish.jersey.client; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.util.List; - -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.core.Request; -import javax.ws.rs.core.Response; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.SSLContext; - -import org.glassfish.jersey.internal.util.CommittingOutputStream; -import org.glassfish.jersey.message.internal.Responses; -import org.glassfish.jersey.process.Inflector; - -import com.google.common.base.Predicates; -import com.google.common.collect.Maps; - -/** - * Default client transport connector using {@link HttpURLConnection}. - * - * @author Marek Potociar (marek.potociar at oracle.com) - */ -public class HttpUrlConnector extends RequestWriter implements Inflector { - - private static InputStream getInputStream(HttpURLConnection uc) throws IOException { - if (uc.getResponseCode() < 300) { - return uc.getInputStream(); - } else { - InputStream ein = uc.getErrorStream(); - return (ein != null) ? ein : new ByteArrayInputStream(new byte[0]); - } - } - - @Override - public Response apply(Request request) { - try { - return _apply(request); - } catch (IOException ex) { - throw new RuntimeException(ex); - } - } - - private Response _apply(final Request request) throws IOException { - final HttpURLConnection uc; - // TODO introduce & leverage optional connection factory to support customized connections - uc = (HttpURLConnection) request.getUri().toURL().openConnection(); - uc.setRequestMethod(request.getMethod()); - - if (uc instanceof HttpsURLConnection) { - if (request.getProperties().containsKey(ClientProperties.HOSTNAME_VERIFIER)) { - final Object o = request.getProperties().get(ClientProperties.HOSTNAME_VERIFIER); - if (o != null && (o instanceof HostnameVerifier)) { - ((HttpsURLConnection) uc).setHostnameVerifier((HostnameVerifier) o); - } - } - - if (request.getProperties().containsKey(ClientProperties.SSL_CONTEXT)) { - final Object o = request.getProperties().get(ClientProperties.SSL_CONTEXT); - if (o != null && (o instanceof SSLContext)) { - ((HttpsURLConnection) uc).setSSLSocketFactory(((SSLContext) o).getSocketFactory()); - } - } - } - - final Object entity = request.getEntity(); - if (entity != null) { - uc.setDoOutput(true); - - writeRequestEntity(request, new RequestEntityWriterListener() { - @Override - public void onRequestEntitySize(long size) { - if (size != -1 && size < Integer.MAX_VALUE) { - System.out.println("setFixedLengthStreamingMode " + size); - // HttpURLConnection uses the int type for content length - - // this just does not work for several consecutive requests. - // another day wasted on HttpUrlConnection bug :/ - //uc.setFixedLengthStreamingMode((int)size); - System.out.println("setChunkedStreamingMode " + size); - uc.setChunkedStreamingMode(256 * 1024); - } else { - // TODO (copied from Jersey 1.x) it appears HttpURLConnection has some bugs in - // chunked encoding - // uc.setChunkedStreamingMode(0); - - // TODO deal with chunked encoding -// Integer chunkedEncodingSize = (Integer)request.getProperties().get( -// ClientConfig.PROPERTY_CHUNKED_ENCODING_SIZE); -// if (chunkedEncodingSize != null) { -// uc.setChunkedStreamingMode(chunkedEncodingSize); -// } - //default - System.out.println("setChunkedStreamingMode " + size); - uc.setChunkedStreamingMode(256 * 1024); - } - } - - @Override - public OutputStream onGetOutputStream() throws IOException { - return new CommittingOutputStream() { - @Override - protected OutputStream getOutputStream() throws IOException { - return uc.getOutputStream(); - } - - @Override - public void commit() throws IOException { - writeOutBoundHeaders(request.getHeaders().asMap(), uc); - } - }; - } - - }); - } else { - writeOutBoundHeaders(request.getHeaders().asMap(), uc); - } - - Response.ResponseBuilder rb = - Responses.from(uc.getResponseCode(), request, getInputStream(uc)); - Responses.fillHeaders(rb, Maps.filterKeys(uc.getHeaderFields(), Predicates.notNull())); - - return rb.build(); - } - - private void writeOutBoundHeaders(MultivaluedMap headers, HttpURLConnection uc) { - for (String key : headers.keySet()) { - List headerValues = headers.get(key); - if (headerValues.size() == 1) { - uc.setRequestProperty(key, headerValues.get(0)); - } else { - StringBuilder b = new StringBuilder(); - boolean add = false; - for (Object value : headerValues) { - if (add) { - b.append(','); - } - add = true; - b.append(value); - } - uc.setRequestProperty(key, b.toString()); - } - } - } -} diff --git a/src/main/java/org/openstack/api/Namespaces.java b/src/main/java/org/openstack/api/Namespaces.java deleted file mode 100644 index c70d864c5..000000000 --- a/src/main/java/org/openstack/api/Namespaces.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.api; - -public class Namespaces { - public static final String NS_OPENSTACK_API_1_1 = "http://docs.openstack.org/compute/api/v1.1"; - public static final String NS_OPENSTACK_COMMON_API_1_0 = "http://docs.openstack.org/common/api/v1.0"; - public static final String NS_OPENSTACK_IDENTITY_2_0 = "http://docs.openstack.org/identity/api/v2.0"; - public static final String NS_OPENSTACK_IDENTITY_ADM_1_0 = "http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0"; - public static final String ATOM = "http://www.w3.org/2005/Atom"; -} diff --git a/src/main/java/org/openstack/api/authentication/AuthenticationProvider.java b/src/main/java/org/openstack/api/authentication/AuthenticationProvider.java deleted file mode 100644 index 52df8815f..000000000 --- a/src/main/java/org/openstack/api/authentication/AuthenticationProvider.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.api.authentication; - -import java.util.Properties; - -public abstract class AuthenticationProvider { - - public abstract Properties authenticate(Properties properties); - -} diff --git a/src/main/java/org/openstack/api/authentication/KeystoneAuthenticationProvider.java b/src/main/java/org/openstack/api/authentication/KeystoneAuthenticationProvider.java deleted file mode 100644 index 634f75397..000000000 --- a/src/main/java/org/openstack/api/authentication/KeystoneAuthenticationProvider.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openstack.api.authentication; - -import java.util.Properties; - -import org.openstack.model.identity.keystone.KeystoneAuthentication; - -public class KeystoneAuthenticationProvider extends AuthenticationProvider { - - public Properties authenticate(Properties properties) { - - String credentials = properties.getProperty("auth.credentials"); - - KeystoneAuthentication authentication = null; - - if("apiAccessKeyCredentials".equals(credentials)) { - String accessKey = properties.getProperty("auth.accessKey"); - String secretKey = properties.getProperty("auth.secretKey"); - authentication = KeystoneAuthentication.withApiAccessKeyCredentials(accessKey, secretKey); - } else { - String username = properties.getProperty("auth.username"); - String password = properties.getProperty("auth.password"); - authentication = KeystoneAuthentication.withPasswordCredentials(username, password); - } - - String tenantId = properties.getProperty("auth.tenantId"); - String tenantName = properties.getProperty("auth.tenantName"); - - if(tenantId != null) { - authentication.setTenantId(tenantId); - } else if(tenantName != null) { - authentication.setTenantName(tenantName); - } - //Access access = client.getIdentityEndpoint().tokens().post(authentication); - return properties; - } - -} diff --git a/src/main/java/org/openstack/api/authentication/SwiftTempAuthenticationProvider.java b/src/main/java/org/openstack/api/authentication/SwiftTempAuthenticationProvider.java deleted file mode 100644 index 31c36bfa3..000000000 --- a/src/main/java/org/openstack/api/authentication/SwiftTempAuthenticationProvider.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openstack.api.authentication; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.ResponseHeaders; - -import org.glassfish.jersey.filter.LoggingFilter; -import org.openstack.api.common.RestClient; - -public class SwiftTempAuthenticationProvider extends AuthenticationProvider { - - public Properties authenticate(Properties properties) { - LoggingFilter logging = new LoggingFilter(); - String account = properties.getProperty("storage.auth.account"); - String username = properties.getProperty("storage.auth.username"); - String password = properties.getProperty("storage.auth.password"); - String endpoint = properties.getProperty("storage.auth.endpoint"); - Target target = RestClient.INSTANCE.getJerseyClient().target(endpoint); - target.configuration().register(logging); - Response response = target.request(MediaType.WILDCARD) - .header("X-Storage-User", account + ":" + username) - .header("X-Storage-Pass", password) - .get(); - ResponseHeaders headers = response.getHeaders(); - properties.setProperty("storage.endpoint", headers.getHeader("X-Storage-Url")); - properties.setProperty("storage.token", headers.getHeader("X-Storage-Token")); - properties.setProperty("auth.token", headers.getHeader("X-Auth-Token")); - return properties; - } - -} diff --git a/src/main/java/org/openstack/api/common/HttpUtils.java b/src/main/java/org/openstack/api/common/HttpUtils.java deleted file mode 100644 index 9628b7a0b..000000000 --- a/src/main/java/org/openstack/api/common/HttpUtils.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.openstack.api.common; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.URL; -import java.util.Map; - -public class HttpUtils { - - public static final void upload(String method, URL url, Map headers, InputStream is) { - - try { - - HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); - - urlc.setRequestMethod("PUT"); - - for(Map.Entry entry : headers.entrySet()) { - urlc.setRequestProperty(entry.getKey(), entry.getValue()); - } - - urlc.setUseCaches(false); - - urlc.setChunkedStreamingMode(32768); - - urlc.setDoInput(true); - - urlc.setDoOutput(true); - - OutputStream out = urlc.getOutputStream(); - - int bytesRead = 0; - - byte b[] = new byte[32768]; - - while (bytesRead >= 0) - - { - - bytesRead = is.read(b); - - if (bytesRead >= 0) out.write(b,0,bytesRead); - - } - - is.close(); - - out.close(); - - int code = urlc.getResponseCode(); - - System.out.println(code); - - urlc.disconnect(); - } catch (IOException e) { - e.printStackTrace(); - } - - } - - -} diff --git a/src/main/java/org/openstack/api/common/OpenstackExceptionClientFilter.java b/src/main/java/org/openstack/api/common/OpenstackExceptionClientFilter.java deleted file mode 100644 index 8061899ef..000000000 --- a/src/main/java/org/openstack/api/common/OpenstackExceptionClientFilter.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openstack.api.common; - -import java.io.IOException; - -import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.FilterContext; -import javax.ws.rs.ext.Provider; -import javax.ws.rs.ext.ResponseFilter; - -import org.openstack.model.exceptions.OpenStackException; - -@Provider -public class OpenstackExceptionClientFilter implements ResponseFilter { - - @Override - public void postFilter(FilterContext context) throws IOException { - /* - int httpStatus = context.getResponse().getStatus(); - if(httpStatus / 100 > 3) { - MediaType responseType = context.getResponse().getHeaders().getMediaType(); - if (responseType != null && responseType.isCompatible(MediaType.APPLICATION_JSON_TYPE)) { - throw context.getResponse().readEntity(OpenStackException.class); - } else if (context.getResponse().hasEntity()) { - throw new OpenStackException(context.getResponse().readEntity(String.class)); - } else { - throw new OpenStackException("Unknown exception"); - } - } - */ - } -} diff --git a/src/main/java/org/openstack/api/common/Resource.java b/src/main/java/org/openstack/api/common/Resource.java deleted file mode 100644 index 43a54f9bf..000000000 --- a/src/main/java/org/openstack/api/common/Resource.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openstack.api.common; - -import java.util.Properties; - -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.InvocationException; -import javax.ws.rs.client.Target; - -import org.openstack.model.exceptions.OpenStackException; - -public class Resource { - - protected Target target; - protected Properties properties; - - protected Resource(Target target, Properties properties) { - this.target = target; - this.properties = properties; - } - - public T path(String relativePath, Class clazz) { - //T instance = clazz.cast(resources.get(relativePath)); - T instance = null; - if (instance == null) { - try { - instance = (T) clazz.getConstructor(Target.class, Properties.class).newInstance(target.path(relativePath), properties); - } catch (Exception e) { - throw new IllegalStateException("Error creating resource instance", e); - } - } - return instance; - } - - public String getURL() { - return target.getUri().toString(); - } - - protected T execute(Invocation invocation, Class responseType) { - try { - return invocation.invoke(responseType); - } catch (InvocationException e) { - throw new OpenStackException(e.getResponse().getStatus(), e.getResponse().readEntity(String.class),e); - } - } - -} diff --git a/src/main/java/org/openstack/api/common/RestClient.java b/src/main/java/org/openstack/api/common/RestClient.java deleted file mode 100644 index 632af6425..000000000 --- a/src/main/java/org/openstack/api/common/RestClient.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.openstack.api.common; - -import javax.ws.rs.client.Client; -import javax.ws.rs.ext.ContextResolver; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; - -import org.codehaus.jackson.map.AnnotationIntrospector; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; -import org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector; -import org.glassfish.jersey.client.JerseyClient; -import org.glassfish.jersey.client.JerseyClientFactory; -import org.glassfish.jersey.media.json.JsonJacksonFeature; - -public enum RestClient { - - INSTANCE; - - private JerseyClient client; - - private RestClient() { - - // - - client = (JerseyClient) JerseyClientFactory.newClient(); - - client.configuration().enable(new JsonJacksonFeature()); - - client.configuration().register(new OpenstackExceptionClientFilter()); - - client.configuration().register(OpenStackObjectMapperProvider.class); - - //client.configuration().register(JaxbContextResolver.class); - - //client.configuration().register(OpenstackJaxbContext.class); - - } - - public Client getJerseyClient() { - return client; - } - - public static final class OpenstackJaxbContext implements ContextResolver { - - private JAXBContext ctx; - - public OpenstackJaxbContext() { - try { - ctx = JAXBContext.newInstance("org.openstack.model.identity:org.openstack.model.compute"); - } catch (JAXBException e) { - throw new RuntimeException(e.getMessage(), e); - } - } - - @Override - public JAXBContext getContext(Class type) { - return ctx; - } - - } - - public static final class OpenStackObjectMapperProvider implements ContextResolver { - - private final ObjectMapper objectMapper; - - public OpenStackObjectMapperProvider() { - objectMapper = new ObjectMapper(); - //objectMapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true); - //objectMapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true); - objectMapper.configure(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); - AnnotationIntrospector introspector = new JacksonAnnotationIntrospector(); - objectMapper.setDeserializationConfig(objectMapper.getDeserializationConfig().withAnnotationIntrospector(introspector)); - objectMapper.setSerializationConfig(objectMapper.getSerializationConfig().withSerializationInclusion(Inclusion.NON_NULL).withAnnotationIntrospector(introspector)); - } - - @Override - public ObjectMapper getContext(Class type) { - JsonRootName jsonRootName = type.getAnnotation(JsonRootName.class); - objectMapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, jsonRootName != null); - objectMapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, jsonRootName != null); - return objectMapper; - } - - } - -} diff --git a/src/main/java/org/openstack/api/compute/AsyncServerOperation.java b/src/main/java/org/openstack/api/compute/AsyncServerOperation.java deleted file mode 100644 index 983209aea..000000000 --- a/src/main/java/org/openstack/api/compute/AsyncServerOperation.java +++ /dev/null @@ -1,169 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Collection; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.logging.Logger; - -import org.openstack.model.compute.Server; -import org.openstack.model.exceptions.OpenStackException; - -import com.google.common.collect.Lists; - -public class AsyncServerOperation implements Future { - static final Logger log = Logger.getLogger(AsyncServerOperation.class.getName()); - - private static final int POLL_INTERVAL_MILLISECONDS = 5000; - - final Server returnValue; - final String serverId; - - final Collection acceptableTransitionStates; - final Collection finishStates; - - final TenantResource client; - - volatile boolean cancelled; - volatile boolean done; - - public AsyncServerOperation(TenantResource client, Server returnValue, String serverId, - Collection acceptableTransitionStates, Collection finishStates) { - super(); - this.client = client; - this.returnValue = returnValue; - this.serverId = serverId; - this.acceptableTransitionStates = acceptableTransitionStates; - this.finishStates = finishStates; - } - - Server waitForState(long timeout, TimeUnit unit) throws OpenStackException { - try { - long timeoutAt = unit != null ? System.currentTimeMillis() + unit.toMillis(timeout) : Long.MAX_VALUE; - while (true) { - Server server = null; - String status; - try { - server = client.servers().server(serverId).get(); - status = server.getStatus(); - } catch (Exception /*OpenstackNotFoundException*/ e) { - // Treat as DELETED - status = "DELETED"; - } - - // Some versions (Diablo?) would return additional information in the status - // e.g. BUILD(networking). We need to split this out. - //String subStatus = null; - if (status.contains("(")) { - int leftBracketIndex = status.indexOf('('); - int rightBracketIndex = status.indexOf(')'); - if (leftBracketIndex != -1 && rightBracketIndex > leftBracketIndex) { - //subStatus = status.substring(leftBracketIndex + 1, rightBracketIndex); - status = status.substring(0, leftBracketIndex); - } - } - - if (finishStates.contains(status)) { - log.fine("Finished polling; server status is " + status); - return server; - } - - if (!acceptableTransitionStates.contains(status)) { - throw new OpenStackException("Server is in unexpected state: " + status); - } - - if (server != null) { - log.fine("Continuing polling; server status is " + status + " progess=" + server.getProgress()); - } else { - log.fine("Continuing polling; server is not found (treated as DELETED)"); - } - - if (System.currentTimeMillis() > timeoutAt) - throw new OpenStackException("Server did not transition to expected state within timeout"); - - try { - Thread.sleep(POLL_INTERVAL_MILLISECONDS); - } catch (InterruptedException e) { - throw new OpenStackException(e.getMessage()); - } - - } - } finally { - done = true; - } - } - - @Override - public boolean cancel(boolean mayInterruptIfRunning) { - throw new UnsupportedOperationException(); - } - - @Override - public Server get() { - try { - return get(0, null); - } catch (Exception e) { - // TimeoutException shouldn't happen without a timeout specified!! - throw new OpenStackException("Unexpected error"); - } - } - - @Override - public Server get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { - try { - return waitComplete(timeout, unit); - } catch (OpenStackException e) { - throw new ExecutionException("Error with OpenStack", e); - } - } - - /** - * This method throws OpenStackComputeException instead of wrapping it in ExecutionException - * - * @throws OpenStackException - */ - public Server waitComplete(long timeout, TimeUnit unit) throws InterruptedException, TimeoutException, - OpenStackException { - return this.waitForState(timeout, unit); - } - - /** - * This method throws OpenStackComputeException instead of wrapping it in ExecutionException - */ - public Server waitComplete() throws InterruptedException, OpenStackException { - try { - return waitComplete(0, null); - } catch (TimeoutException e) { - // Shouldn't happen without a timeout specified!! - throw new IllegalStateException("Unexpected timeout error", e); - } - } - - @Override - public boolean isCancelled() { - return cancelled; - } - - @Override - public boolean isDone() { - return done; - } - - /** - * The server that was initially returned by the initial async call - * - * @return - */ - public Server getReturnedServer() { - return returnValue; - } - - public static AsyncServerOperation wrapServerCreate(TenantResource client, Server server) { - return new AsyncServerOperation(client, server, server.getId(), Lists.newArrayList("BUILD"), Lists.newArrayList("ACTIVE")); - } - - public static AsyncServerOperation wrapServerDelete(TenantResource client, Server server) { - return new AsyncServerOperation(client, server, server.getId(), Lists.newArrayList("ACTIVE"), Lists.newArrayList("DELETED")); - } -} diff --git a/src/main/java/org/openstack/api/compute/ConsoleResource.java b/src/main/java/org/openstack/api/compute/ConsoleResource.java deleted file mode 100644 index 03c6da281..000000000 --- a/src/main/java/org/openstack/api/compute/ConsoleResource.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Console; -import org.openstack.model.compute.nova.NovaConsole; - -public class ConsoleResource extends Resource { - - public ConsoleResource(Target target, Properties properties) { - super(target, properties); - } - - public Console get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaConsole.class); - } - -// public void delete() { -// resource().post(String.class); -// } - -} - diff --git a/src/main/java/org/openstack/api/compute/ConsolesResource.java b/src/main/java/org/openstack/api/compute/ConsolesResource.java deleted file mode 100644 index cea6adabc..000000000 --- a/src/main/java/org/openstack/api/compute/ConsolesResource.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Console; -import org.openstack.model.compute.ConsoleList; -import org.openstack.model.compute.nova.NovaConsole; -import org.openstack.model.compute.nova.NovaConsoleList; - -public class ConsolesResource extends Resource { - - public ConsolesResource(Target target, Properties properties) { - super(target, properties); - } - - public ConsoleList get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaConsoleList.class); - } - - public Console post(Entity rule) { - // OSAPI bug: Can't specify an SSH key in XML? - return target.request(MediaType.APPLICATION_JSON).post(rule, NovaConsole.class); - } - - public ConsoleResource console(String id) { - return new ConsoleResource(target.path("/{id}").pathParam("id", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ExtensionResource.java b/src/main/java/org/openstack/api/compute/ExtensionResource.java deleted file mode 100644 index 59d50be73..000000000 --- a/src/main/java/org/openstack/api/compute/ExtensionResource.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.common.Extension; - -public class ExtensionResource extends Resource { - - public ExtensionResource(Target target, Properties properties) { - super(target, properties); - } - - public Extension get() { - return target.request(MediaType.APPLICATION_JSON).get(Extension.class); - } -} diff --git a/src/main/java/org/openstack/api/compute/ExtensionsResource.java b/src/main/java/org/openstack/api/compute/ExtensionsResource.java deleted file mode 100644 index acacc20e6..000000000 --- a/src/main/java/org/openstack/api/compute/ExtensionsResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.common.ExtensionList; - -public class ExtensionsResource extends Resource { - - public ExtensionsResource(Target target, Properties properties) { - super(target, properties); - } - - public ExtensionList get() { - return target.request(MediaType.APPLICATION_JSON).get(ExtensionList.class); - } - - public ExtensionResource extension(String alias) { - return new ExtensionResource(target.path("/{alias}").pathParam("alias", alias), properties); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/FlavorResource.java b/src/main/java/org/openstack/api/compute/FlavorResource.java deleted file mode 100644 index a5ee4c75f..000000000 --- a/src/main/java/org/openstack/api/compute/FlavorResource.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Flavor; -import org.openstack.model.compute.nova.NovaFlavor; - -public class FlavorResource extends Resource { - - public FlavorResource(Target target, Properties properties) { - super(target, properties); - } - - public Flavor get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaFlavor.class); - } - - public Response delete() { - return target.request(MediaType.WILDCARD).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/compute/FlavorsResource.java b/src/main/java/org/openstack/api/compute/FlavorsResource.java deleted file mode 100644 index 8f3655505..000000000 --- a/src/main/java/org/openstack/api/compute/FlavorsResource.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Flavor; -import org.openstack.model.compute.FlavorList; -import org.openstack.model.compute.nova.NovaFlavorList; - -public class FlavorsResource extends Resource { - - public FlavorsResource(Target target, Properties properties) { - super(target, properties); - } - - public FlavorList get(Map filters) { - Target target = this.target.path("/detail"); - if(filters != null) { - if(filters.get("minDisk") != null) { - target = target.queryParam("minDisk", filters.get("minDisk")); - } - if(filters.get("minRam") != null) { - target = target.queryParam("minRam", filters.get("minRam")); - } - if(filters.get("marker") != null) { - target = target.queryParam("marker", filters.get("marker")); - } - if(filters.get("limit") != null) { - target = target.queryParam("limit", filters.get("marker")); - } - } - return target.request(MediaType.APPLICATION_JSON).get(NovaFlavorList.class); - } - - public FlavorList get() { - return get(null); - } - - public Flavor post(Flavor flavor) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(flavor, MediaType.APPLICATION_JSON), Flavor.class); - } - - public FlavorResource flavor(String id) { - return new FlavorResource(target.path("/{id}").pathParam("id", id), properties); - } - - - -} diff --git a/src/main/java/org/openstack/api/compute/ImageResource.java b/src/main/java/org/openstack/api/compute/ImageResource.java deleted file mode 100644 index 420cdb83a..000000000 --- a/src/main/java/org/openstack/api/compute/ImageResource.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Image; -import org.openstack.model.compute.nova.NovaImage; - -public class ImageResource extends Resource { - - public ImageResource(Target target, Properties properties) { - super(target, properties); - } - - public Image get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaImage.class); - } - - public Response delete() { - return target.request(MediaType.WILDCARD).delete(); - } - - /* - public Metadata metadata() { - // /metadata - return new NovaMetadata(); - } - */ - -} diff --git a/src/main/java/org/openstack/api/compute/ImagesResource.java b/src/main/java/org/openstack/api/compute/ImagesResource.java deleted file mode 100644 index b73a8f8fc..000000000 --- a/src/main/java/org/openstack/api/compute/ImagesResource.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.ImageList; -import org.openstack.model.compute.nova.NovaImageList; - -public class ImagesResource extends Resource { - - public ImagesResource(Target target, Properties properties) { - super(target, properties); - } - - public ImageList get(Map filters) { - Target target = this.target.path("/detail"); - if(filters != null) { - if(filters.get("server") != null) { - target = target.queryParam("server", filters.get("server")); - } - if(filters.get("name") != null) { - target = target.queryParam("name", filters.get("name")); - } - if(filters.get("status") != null) { - target = target.queryParam("status", filters.get("status")); - } - if(filters.get("marker") != null) { - target = target.queryParam("marker", filters.get("marker")); - } - if(filters.get("limit") != null) { - target = target.queryParam("limit", filters.get("marker")); - } - if(filters.get("changes-since") != null) { - target = target.queryParam("changes-since", filters.get("changes-since")); - } - if(filters.get("type") != null) { - target = target.queryParam("type", filters.get("type")); - } - } - return target.request(MediaType.APPLICATION_JSON).get(NovaImageList.class); - } - - public ImageList get() { - return get(null); - } - - public ImageResource image(String id) { - return new ImageResource(target.path("/{id}").pathParam("id", id), properties); - } - - - -} diff --git a/src/main/java/org/openstack/api/compute/MetadataResource.java b/src/main/java/org/openstack/api/compute/MetadataResource.java deleted file mode 100644 index 9b1bebc92..000000000 --- a/src/main/java/org/openstack/api/compute/MetadataResource.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; - -import javax.ws.rs.client.Target; - -import org.openstack.api.common.Resource; - -public class MetadataResource extends Resource { - - protected MetadataResource(Target target, Properties properties) { - super(target, properties); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/ServerActionResource.java b/src/main/java/org/openstack/api/compute/ServerActionResource.java deleted file mode 100644 index 2acf2660c..000000000 --- a/src/main/java/org/openstack/api/compute/ServerActionResource.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.ServerAction; - -public class ServerActionResource extends Resource { - - public ServerActionResource(Target target, Properties properties) { - super(target, properties); - } - - public T post(ServerAction action, Class type) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(action, MediaType.APPLICATION_JSON), type); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ServerResource.java b/src/main/java/org/openstack/api/compute/ServerResource.java deleted file mode 100644 index f4a55e8c2..000000000 --- a/src/main/java/org/openstack/api/compute/ServerResource.java +++ /dev/null @@ -1,418 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.api.compute.ext.FloatingIpsResource; -import org.openstack.api.compute.ext.SecurityGroupsResource; -import org.openstack.api.compute.ext.VolumeAttachmentsResource; -import org.openstack.model.compute.SecurityGroupList; -import org.openstack.model.compute.Server; -import org.openstack.model.compute.nova.NovaServer; -import org.openstack.model.compute.nova.server.actions.AddFixedIpAction; -import org.openstack.model.compute.nova.server.actions.AssociateFloatingIpAction; -import org.openstack.model.compute.nova.server.actions.ChangePasswordAction; -import org.openstack.model.compute.nova.server.actions.ConfirmResizeAction; -import org.openstack.model.compute.nova.server.actions.Console; -import org.openstack.model.compute.nova.server.actions.CreateBackupAction; -import org.openstack.model.compute.nova.server.actions.DisassociateFloatingIpAction; -import org.openstack.model.compute.nova.server.actions.ForceDeleteAction; -import org.openstack.model.compute.nova.server.actions.GetConsoleOutputAction; -import org.openstack.model.compute.nova.server.actions.GetVncConsoleAction; -import org.openstack.model.compute.nova.server.actions.InjectNetworkInfoAction; -import org.openstack.model.compute.nova.server.actions.LockAction; -import org.openstack.model.compute.nova.server.actions.MigrateAction; -import org.openstack.model.compute.nova.server.actions.Output; -import org.openstack.model.compute.nova.server.actions.PauseAction; -import org.openstack.model.compute.nova.server.actions.RebootAction; -import org.openstack.model.compute.nova.server.actions.RebuildAction; -import org.openstack.model.compute.nova.server.actions.RemoveFixedIpAction; -import org.openstack.model.compute.nova.server.actions.ResetNetworkAction; -import org.openstack.model.compute.nova.server.actions.ResizeAction; -import org.openstack.model.compute.nova.server.actions.RestoreAction; -import org.openstack.model.compute.nova.server.actions.ResumeAction; -import org.openstack.model.compute.nova.server.actions.RevertResize; -import org.openstack.model.compute.nova.server.actions.SuspendAction; -import org.openstack.model.compute.nova.server.actions.UnlockAction; -import org.openstack.model.compute.nova.server.actions.UnpauseAction; - -public class ServerResource extends Resource { - - public static final String REBOOT_HARD = "HARD"; - public static final String REBOOT_SOFT = "SOFT"; - - public static class IpsResource extends Resource { - - public IpsResource(Target target, Properties properties) { - super(target, properties); - } - - public String get(Map properties, String networkId) { - return target.path("/ips").request(MediaType.APPLICATION_JSON).get(String.class); - } - - } - - public ServerResource(Target target, Properties properties) { - super(target, properties); - } - - public Server get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaServer.class); - } - - public Server put(Server server) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.entity(server, MediaType.APPLICATION_JSON), NovaServer.class); - } - - public Response delete() { - return target.request(MediaType.WILDCARD).delete(); - } - - public ServerActionResource action() { - return path("/action", ServerActionResource.class); - } - - /** - * Restore a previously deleted instance. - * - */ - public void restore() { - executeAction(String.class, new RestoreAction()); - } - - /** - * Force delete of instance before deferred cleanup. - * - */ - public void forceDelete() { - executeAction(String.class, new ForceDeleteAction()); - } - - /** - * Update the password for a server. - * - * @param adminPass - */ - public void changePassword(String adminPass) { - ChangePasswordAction changePasswordAction = new ChangePasswordAction(); - changePasswordAction.setAdminPass(adminPass); - executeAction(String.class, changePasswordAction); - } - - /** - * Reboot a server. - * - * Usage: server.reboot(ServerResource.REBOOT_HARD); - * @param type - * either ServerResource.REBOOT_SOFT for a software-level reboot, or ServerResource.REBOOT_HARD for a virtual power cycle hard reboot. - */ - public void reboot(String type) { - RebootAction rebootAction = new RebootAction(); - rebootAction.setType(type); - executeAction(String.class, rebootAction); - } - - /** - * Rebuild -- shut down and then re-image -- a server. - * - * @param rebuildAction - */ - public void rebuild(RebuildAction rebuildAction) { - executeAction(String.class, rebuildAction); - } - - public void resize(ResizeAction resizeAction) { - executeAction(String.class, resizeAction); - } - - /** - * Confirm that the resize worked, thus removing the original server. - * - */ - public void confirmResize() { - executeAction(String.class, new ConfirmResizeAction()); - } - - /** - * Revert a previous resize, switching back to the old server. - * - */ - public void revertResize() { - executeAction(String.class, new RevertResize()); - } - - /** - * Snapshot a server. - * - * @param name - * Name to give the snapshot image - * @param metadata - * to give newly-created image entity - * - */ - public void createImage(String name, Map metadata) { - throw new UnsupportedOperationException("Not implemented yet"); - } - - /** - * Permit Admins to pause the server - * - * @return - */ - public void pause() { - executeAction(String.class, new PauseAction()); - } - - /** - * Permit Admins to unpause the server - * - * @return - */ - public void unpause() { - executeAction(String.class, new UnpauseAction()); - } - - /** - * Permit Admins to suspend the server - * - * @return - */ - public void suspend() { - executeAction(String.class, new SuspendAction()); - } - /** - * Permit admins to resume the server from suspend - * - * @return - */ - public void resume() { - executeAction(String.class, new ResumeAction()); - } - - /** - * Resize a server's resources. - * - * flavor: the :class:`Flavor` (or its ID) to resize to. - * - * Until a resize event is confirmed with :meth:`confirm_resize`, the old server will be kept around and you'll be - * able to roll back to the old flavor quickly with :meth:`revert_resize`. All resizes are automatically confirmed - * after 24 hours. - */ - public void resize(String flavorId) { - ResizeAction resizeAction = new ResizeAction(); - // resizeAction.setAutoDiskConfig(autoDiskConfig); - resizeAction.setFlavorRef(flavorId); - executeAction(String.class, resizeAction); - } - - /** - * Migrate a server to a new host in the same zone. - * Permit admins to migrate a server to a new host - * - */ - - public void migrate() { - executeAction(String.class, new MigrateAction()); - } - - /** - * Permit admins to reset networking on an server - * - * @return - */ - public void resetNetwork() { - executeAction(String.class, new ResetNetworkAction()); - } - - /** - * Permit admins to inject network info into a server - * - * @return - */ - public void injectNetworkInfo() { - executeAction(String.class, new InjectNetworkInfoAction()); - } - - /** - * Permit admins to lock a server - * - * @ - */ - public void lock() { - executeAction(String.class, new LockAction()); - } - - /** - * Permit admins to unlock a server - * - * @return - */ - public void unlock() { - executeAction(String.class, new UnlockAction()); - } - - /** - * Allow Admins to view pending server actions - * - * @return - */ - public String pendingActions() { - return target.path("actions").request().get(String.class); - } - - public String virtualInterfaces() { - return target.path("os-virtual-interfaces").request().get(String.class); - } - - public void createBackup(CreateBackupAction createBackupAction) { - - } - - /** - * Allow Admins to view server diagnostics through server action - * - * @return - */ - public String diagnostics() { - return target.path("diagnostics").request().get(String.class); - } - - public IpsResource ips() { - return path("ips", IpsResource.class); - } - - public MetadataResource metadata() { - return path("metadata", MetadataResource.class); - } - - /** - * Adds an IP on a given network to an instance. - * - * @return - */ - public String addFixedIp(String networkId) { - AddFixedIpAction addFixedIpAction = new AddFixedIpAction(); - addFixedIpAction.setNetworkId(networkId); - return executeAction(String.class, addFixedIpAction); - } - - /** - * Removes an IP from an instance. - * - * @return - */ - public String removeFixedIp(String address) { - RemoveFixedIpAction removeFixedIpAction = new RemoveFixedIpAction(); - removeFixedIpAction.setAddress(address); - return executeAction(String.class, removeFixedIpAction); - } - - /** - * Attaches a floating IP to the instance. - */ - public void addFloatingIp(String ip) { - AssociateFloatingIpAction action = new AssociateFloatingIpAction(ip); - executeAction(String.class, action); - } - - /** - * Detaches a floating IP from the instance - */ - public void removeFloatingIp(String ip) { - DisassociateFloatingIpAction action = new DisassociateFloatingIpAction(ip); - executeAction(String.class, action); - } - - /** - * Get text console log output from Server. - * - * @return - */ - public Console getVncConsole(String type) { - GetVncConsoleAction action = new GetVncConsoleAction(); - action.setType(type); - Console console = executeAction(Console.class, action); - return console; - } - - /** - * Get text console output. - * - * @return - */ - public String getConsoleOutput(Integer length) { - GetConsoleOutputAction action = new GetConsoleOutputAction(); - action.setLength(length); - - // XML output is not escaped correctly. Bug #939386 - Output output = executeAction(Output.class, action, MediaType.APPLICATION_JSON_TYPE); - return output.getOutput(); - } - - public T executeAction(Class c, Object action) { - return executeAction(c, action, null); - } - - private T executeAction(Class c, Object action, MediaType forceType) { - return target.path("action").request(forceType).post(Entity.xml(action), c); - } - - public VolumeAttachmentsResource attachments() { - return path("os-volume_attachments", VolumeAttachmentsResource.class); - } - - public FloatingIpsResource floatingIps() { - return path("os-floating-ips", FloatingIpsResource.class); - } - - public ConsolesResource consoles() { - return path("consoles", ConsolesResource.class); - } - - public SecurityGroupList listSecurityGroups() { - return path("os-security-groups", SecurityGroupsResource.class).get(); - } - - /** - * Rescue an instance. - * - * @return - */ - public String rescue() { - return null; - } - - /** - * Rescue an instance. - * - * @return - */ - public String unrescue() { - return null; - } - - /** - * Backup a server instance. - * - * Images now have an `image_type` associated with them, which can be 'snapshot' or the backup type, like 'daily' or - * 'weekly'. - * - * If the image_type is backup-like, then the rotation factor can be included and that will cause the oldest backups - * that exceed the rotation factor to be deleted. - * - * @return - */ - public String backup() { - return null; - } - - - -} diff --git a/src/main/java/org/openstack/api/compute/ServersResource.java b/src/main/java/org/openstack/api/compute/ServersResource.java deleted file mode 100644 index 605188b85..000000000 --- a/src/main/java/org/openstack/api/compute/ServersResource.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Server; -import org.openstack.model.compute.ServerForCreate; -import org.openstack.model.compute.ServerList; -import org.openstack.model.compute.nova.NovaServer; -import org.openstack.model.compute.nova.NovaServerList; - -public class ServersResource extends Resource { - - public ServersResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Returns a list of server names and ids for a given user - * - * Returns a list of servers, taking into account any search options specified. - * - * If detail is true: - * - * Returns a list of server details for a given user - * - * @param detail - * @return - */ - public ServerList get(Map filters) { - Target target = this.target.path("/detail"); - if(filters != null) { - if(filters.get("all_tenants") != null) { - target = target.queryParam("all_tenants", filters.get("all_tenants")); - } - if(filters.get("image") != null) { - target = target.queryParam("image", filters.get("image")); - } - if(filters.get("flavor") != null) { - target = target.queryParam("flavor", filters.get("flavor")); - } - if(filters.get("name") != null) { - target = target.queryParam("name", filters.get("name")); - } - if(filters.get("status") != null) { - target = target.queryParam("status", filters.get("status")); - } - if(filters.get("marker") != null) { - target = target.queryParam("marker", filters.get("marker")); - } - if(filters.get("limit") != null) { - target = target.queryParam("limit", filters.get("marker")); - } - if(filters.get("changes-since") != null) { - target = target.queryParam("changes-since", filters.get("changes-since")); - } - if(filters.get("deleted") != null) { - target = target.queryParam("deleted", filters.get("deleted")); - } - } - return target.request(MediaType.APPLICATION_JSON).get(NovaServerList.class); - } - - - public ServerList get() { - return get(null); - } - - public Server post(ServerForCreate serverForCreate) { - // OSAPI bug: Can't specify an SSH key in XML? - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(serverForCreate, MediaType.APPLICATION_JSON), NovaServer.class); - } - - public ServerResource server(String id) { - return new ServerResource(target.path("/{id}").pathParam("id", id), properties); - } - - - - - - - -} diff --git a/src/main/java/org/openstack/api/compute/TenantResource.java b/src/main/java/org/openstack/api/compute/TenantResource.java deleted file mode 100644 index f8807bf85..000000000 --- a/src/main/java/org/openstack/api/compute/TenantResource.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.openstack.api.compute; - -import java.util.Properties; -import java.util.logging.Logger; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.Target; - -import org.glassfish.jersey.filter.LoggingFilter; -import org.openstack.api.common.Resource; -import org.openstack.api.compute.ext.AggregatesResource; -import org.openstack.api.compute.ext.CloudPipesResource; -import org.openstack.api.compute.ext.FloatingIpDnsResource; -import org.openstack.api.compute.ext.FloatingIpPoolsResource; -import org.openstack.api.compute.ext.FloatingIpsResource; -import org.openstack.api.compute.ext.HostsResource; -import org.openstack.api.compute.ext.KeyPairsResource; -import org.openstack.api.compute.ext.NetworksResource; -import org.openstack.api.compute.ext.QuotasResource; -import org.openstack.api.compute.ext.SecurityGroupRulesResource; -import org.openstack.api.compute.ext.SecurityGroupsResource; -import org.openstack.api.compute.ext.SimpleTenantUsagesResource; -import org.openstack.api.compute.ext.SnapshotsResource; -import org.openstack.api.compute.ext.VolumeTypesResource; -import org.openstack.api.compute.ext.VolumesResource; -import org.openstack.api.compute.notavailable.AccountsResource; - -public class TenantResource extends Resource { - - private LoggingFilter loggingFilter = new LoggingFilter(Logger.getLogger(TenantResource.class.getPackage().getName()),true); - - public TenantResource(Target target, Properties properties) { - super(target, properties); - if(Boolean.parseBoolean(properties.getProperty("verbose"))) { - target.configuration().register(loggingFilter); - } - } - - public static TenantResource endpoint(Client client, String tenantEndpoint, Properties properties) { - return new TenantResource(client.target(tenantEndpoint), properties); - } - - public ServersResource servers() { - return path("/servers", ServersResource.class); - } - - public FlavorsResource flavors() { - return path("/flavors", FlavorsResource.class); - } - - public ImagesResource images() { - return path("/images", ImagesResource.class); - } - - public VolumeTypesResource volumeTypes() { - return path("/os-volume-types", VolumeTypesResource.class); - } - - public VolumesResource volumes() { - return path("/os-volumes", VolumesResource.class); - } - - public SimpleTenantUsagesResource usages() { - return new SimpleTenantUsagesResource(target.path("/os-simple-tenant-usage"), properties); - } - - public QuotasResource quotas(String id) { - return new QuotasResource(target.path("/os-quota-sets/{id}").pathParam("id", id), properties); - //return path(""+id, QuotasResource.class); - } - - public NetworksResource networks() { - return path("/os-networks", NetworksResource.class); - } - - public FloatingIpsResource floatingIps() { - return path("/os-floating-ips", FloatingIpsResource.class); - } - - public FloatingIpPoolsResource floatingIpPools() { - return path("/os-floating-ip-pools", FloatingIpPoolsResource.class); - } - - public FloatingIpDnsResource floatingIpDns() { - return path("/os-floating-ip-dns", FloatingIpDnsResource.class); - } - - public CloudPipesResource cloudPipe() { - return path("/os-cloudpipe", CloudPipesResource.class); - } - - public AccountsResource accounts() { - return path("/accounts", AccountsResource.class); - } - - public KeyPairsResource keyPairs() { - return path("/os-keypairs", KeyPairsResource.class); - } - - public SecurityGroupsResource securityGroups() { - return path("/os-security-groups", SecurityGroupsResource.class); - } - - public SecurityGroupRulesResource securityGroupRules() { - return path("/os-security-group-rules", SecurityGroupRulesResource.class); - } - - public ExtensionsResource extensions() { - return path("/extensions", ExtensionsResource.class); - } - - public SnapshotsResource snapshots() { - return path("/os-snapshots", SnapshotsResource.class); - } - - public AggregatesResource aggregates() { - return path("/os-aggregates", AggregatesResource.class); - } - - public HostsResource hosts() { - return path("/os-hosts", HostsResource.class); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/AggregateResource.java b/src/main/java/org/openstack/api/compute/ext/AggregateResource.java deleted file mode 100644 index 8634069c1..000000000 --- a/src/main/java/org/openstack/api/compute/ext/AggregateResource.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.aggregate.Aggregate; -import org.openstack.model.compute.nova.aggregate.AggregateAction; - -public class AggregateResource extends Resource { - - public AggregateResource(Target target, Properties properties) { - super(target, properties); - } - - public Aggregate get() { - return target.request(MediaType.APPLICATION_JSON).get(Aggregate.class); - } - - public Aggregate post(AggregateAction action) { - //return target.path("/action").request(MediaType.APPLICATION_JSON).post(Entity.entity(action, MediaType.APPLICATION_JSON), Aggregate.class); - return execute(target.path("/action").request(MediaType.APPLICATION_JSON).buildPost(Entity.entity(action, MediaType.APPLICATION_JSON)), Aggregate.class); - - } - - public String delete() { - return target.request(MediaType.APPLICATION_JSON).delete(String.class); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/AggregatesResource.java b/src/main/java/org/openstack/api/compute/ext/AggregatesResource.java deleted file mode 100644 index b58347b83..000000000 --- a/src/main/java/org/openstack/api/compute/ext/AggregatesResource.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.aggregate.Aggregate; -import org.openstack.model.compute.nova.aggregate.AggregateForCreate; -import org.openstack.model.compute.nova.aggregate.AggregateList; - -public class AggregatesResource extends Resource { - - public AggregatesResource(Target target, Properties properties) { - super(target, properties); - } - - public AggregateList get() { - return target.request(MediaType.APPLICATION_JSON).get(AggregateList.class); - } - - public Aggregate post(AggregateForCreate aggregate) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(aggregate, MediaType.APPLICATION_JSON), Aggregate.class); - } - - public AggregateResource aggregate(String id) { - return new AggregateResource(target.path("/{aggregateId}").pathParam("aggregateId", id), properties); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/CloudPipesResource.java b/src/main/java/org/openstack/api/compute/ext/CloudPipesResource.java deleted file mode 100644 index 81c7ae40f..000000000 --- a/src/main/java/org/openstack/api/compute/ext/CloudPipesResource.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.cloudpipe.NovaCloudPipeForCreate; - -/** - * - * """A cloudpipe instance is a VPN attached to a proejct's VLAN.""" - * - * Adds actions to create cloudpipe instances. - * - * When running with the Vlan network mode, you need a mechanism to route from - * the public Internet to your vlans. This mechanism is known as a cloudpipe. - * - * At the time of creating this class, only OpenVPN is supported. Support for a - * SSH Bastion host is forthcoming. - * - * - * Creating a Cloudpipe Image - * - * To make a cloudpipe image: - * - * install openvpn on a base ubuntu image. - * - * set up a server.conf.template in /etc/openvpn/ - - set up.sh in /etc/openvpn/ - - set down.sh in /etc/openvpn/ - - download and run the payload on boot from /etc/rc.local - - setup /etc/network/interfaces - - upload the image and set the image id in your config file: - - vpn_image_id=[uuid from glance] - - - you should set a few other configuration options to make VPNs work properly: - - use_project_ca=True - cnt_vpn_clients=5 - force_dhcp_release=True - - creates a keypair called -vpn and saves it in the keys directory - - creates a security group -vpn and opens up 1194 and icmp - - creates a cert and private key for the VPN instance and saves it in the CA/projects// directory - - zips up the info and puts it b64 encoded as user data - - launches an [vpn_instance_type] instance with the above settings using the option-specified VPN image - * - * @author sp - * - */ -public class CloudPipesResource extends Resource { - - public CloudPipesResource(Target target, Properties properties) { - super(target, properties); - } - - public Response get() { - return target.request(MediaType.APPLICATION_JSON).get(); - } - - /** - * Create a new cloudpipe instance, if none exists. - * - * @param cloudpipeForCreate - * @return - */ - public Response post(NovaCloudPipeForCreate cloudpipeForCreate) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(cloudpipeForCreate, MediaType.APPLICATION_JSON)); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsDomainResource.java b/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsDomainResource.java deleted file mode 100644 index db5f609bb..000000000 --- a/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsDomainResource.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.floatingipdns.DomainEntry; - -public class FloatingIpDnsDomainResource extends Resource { - - public FloatingIpDnsDomainResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Return a list of dns entries for the specified domain and ip. - * - * @return - */ - - public String put(DomainEntry domainEntry) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(domainEntry), String.class); - } - - public String delete() { - return target.request(MediaType.APPLICATION_JSON).delete(String.class); - } - - public FloatingIpDnsEntriesResource entries() { - return new FloatingIpDnsEntriesResource(target.path("/entries"), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsEntriesResource.java b/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsEntriesResource.java deleted file mode 100644 index 0ad831ca1..000000000 --- a/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsEntriesResource.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.floatingipdns.DnsEntry; - -public class FloatingIpDnsEntriesResource extends Resource { - - public FloatingIpDnsEntriesResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Return a list of dns entries for the specified domain and ip. - * - * @return - */ - public String get(String ip) { - return target.queryParam("ip", ip).request(MediaType.APPLICATION_JSON).get(String.class); - } - - public String put(DnsEntry dnsEntry) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(dnsEntry), String.class); - } - - public FloatingIpDnsEntryResource entry(String name) { - return new FloatingIpDnsEntryResource(target.path("/{name}").pathParam("name", name), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsEntryResource.java b/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsEntryResource.java deleted file mode 100644 index 9b83f0f54..000000000 --- a/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsEntryResource.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.floatingipdns.DnsEntry; - -public class FloatingIpDnsEntryResource extends Resource { - - public FloatingIpDnsEntryResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Return a list of dns entries for the specified domain and ip. - * - * @return - */ - public String get() { - return target.request(MediaType.APPLICATION_JSON).get(String.class); - } - - public String put(DnsEntry dnsEntry) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(dnsEntry), String.class); - } - - public String delete() { - return target.request(MediaType.APPLICATION_JSON).delete(String.class); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsResource.java b/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsResource.java deleted file mode 100644 index 2a4cc5e3b..000000000 --- a/src/main/java/org/openstack/api/compute/ext/FloatingIpDnsResource.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -public class FloatingIpDnsResource extends Resource { - - public FloatingIpDnsResource(Target target, Properties properties) { - super(target, properties); - } - - public String get() { - return target.request(MediaType.APPLICATION_JSON).get(String.class); - } - - public FloatingIpDnsDomainResource domain(String domain) { - return new FloatingIpDnsDomainResource(target.path("/{domain}").pathParam("domain", domain), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/FloatingIpPoolsResource.java b/src/main/java/org/openstack/api/compute/ext/FloatingIpPoolsResource.java deleted file mode 100644 index d1528ec40..000000000 --- a/src/main/java/org/openstack/api/compute/ext/FloatingIpPoolsResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -/** - * Floating IPs support - * - * @author sp - * - */ -public class FloatingIpPoolsResource extends Resource { - - public FloatingIpPoolsResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Return a list of floating ips allocated to a project. - * - * @return - */ - public String get() { - return target.request(MediaType.APPLICATION_JSON).get(String.class); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/FloatingIpResource.java b/src/main/java/org/openstack/api/compute/ext/FloatingIpResource.java deleted file mode 100644 index b6ab3c57d..000000000 --- a/src/main/java/org/openstack/api/compute/ext/FloatingIpResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.FloatingIp; -import org.openstack.model.compute.nova.floatingip.NovaFloatingIp; - -/** - * FloatingIpResource Support - * - * @author sp - * - */ -public class FloatingIpResource extends Resource { - - public FloatingIpResource(Target target, Properties properties) { - super(target, properties); - } - - public FloatingIp get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaFloatingIp.class); - } - - public void delete() { - target.request(MediaType.WILDCARD).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/FloatingIpsResource.java b/src/main/java/org/openstack/api/compute/ext/FloatingIpsResource.java deleted file mode 100644 index 3181f8477..000000000 --- a/src/main/java/org/openstack/api/compute/ext/FloatingIpsResource.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.FloatingIp; -import org.openstack.model.compute.FloatingIpList; -import org.openstack.model.compute.nova.floatingip.NovaFloatingIp; -import org.openstack.model.compute.nova.floatingip.NovaFloatingIpList; - -/** - * Floating IPs support - * - * @author sp - * - */ -//Floating IPs seems to be JSON only -// TODO: Is this an OpenStack bug or an HP bug? -public class FloatingIpsResource extends Resource { - - public FloatingIpsResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Return a list of floating ips allocated to a project. - * - * @return - */ - public FloatingIpList get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaFloatingIpList.class); - } - - public FloatingIp post(String pool) { - Map body = new HashMap(); - if(pool != null) { - body.put("pool", pool); - } - return target.request(MediaType.APPLICATION_JSON).post(Entity.json(body), NovaFloatingIp.class); - } - - public FloatingIpResource floatingIp(Integer id) { - return new FloatingIpResource(target.path("/{id}").pathParam("id", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/HostResource.java b/src/main/java/org/openstack/api/compute/ext/HostResource.java deleted file mode 100644 index 526e4d5e9..000000000 --- a/src/main/java/org/openstack/api/compute/ext/HostResource.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.host.NovaHost; -import org.openstack.model.compute.nova.host.UpdateNovaHostRequest; - -/** - * Admin-only host administration - * - * @author sp - * - */ -public class HostResource extends Resource { - - public HostResource(Target target, Properties properties) { - super(target, properties); - } - - public String put(UpdateNovaHostRequest request) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(request), String.class); - } - - public NovaHost get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaHost.class); - } - - public String get(HostAction action) { - switch (action) { - case STARTUP: - return target.path("/startup").request(MediaType.APPLICATION_JSON).get(String.class); - case SHUTDOWN: - return target.path("/shutdown").request(MediaType.APPLICATION_JSON).get(String.class); - case REBOOT: - return target.path("/reboot").request(MediaType.APPLICATION_JSON).get(String.class); - default: - throw new UnsupportedOperationException(); - } - - } - - public static enum HostAction { - STARTUP, SHUTDOWN, REBOOT - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/HostsResource.java b/src/main/java/org/openstack/api/compute/ext/HostsResource.java deleted file mode 100644 index f0f0ce566..000000000 --- a/src/main/java/org/openstack/api/compute/ext/HostsResource.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -/** - * Admin-only host administration - * - * @author sp - * - */ -public class HostsResource extends Resource { - - public HostsResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Shows the physical/usage resource given by hosts. - * @return - */ - public String get() { - return target.request(MediaType.APPLICATION_JSON).get(String.class); - } - - public HostResource host(String id) { - return new HostResource(target.path("/{hostId}").pathParam("hostId", id), properties); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/KeyPairResource.java b/src/main/java/org/openstack/api/compute/ext/KeyPairResource.java deleted file mode 100644 index eddad9d36..000000000 --- a/src/main/java/org/openstack/api/compute/ext/KeyPairResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -/** - * Keypair Support - * - * @author sp - * - */ -public class KeyPairResource extends Resource { - - public KeyPairResource(Target target, Properties properties) { - super(target, properties); - } - - - public void delete() { - target.request(MediaType.WILDCARD).delete(); - } - - // OSAPI-BUG: This function is missing from the OS API - // public KeyPair show() { - // return resource().get(KeyPair.class); - // } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/KeyPairsResource.java b/src/main/java/org/openstack/api/compute/ext/KeyPairsResource.java deleted file mode 100644 index 7961e3f3d..000000000 --- a/src/main/java/org/openstack/api/compute/ext/KeyPairsResource.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.KeyPair; -import org.openstack.model.compute.KeyPairList; -import org.openstack.model.compute.nova.keypair.NovaKeyPair; -import org.openstack.model.compute.nova.keypair.NovaKeyPairList; - -/** - * Keypair Support - * - * @author sp - * - */ -public class KeyPairsResource extends Resource { - - public KeyPairsResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * List of keypairs for a user - * - * @return - */ - public KeyPairList get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaKeyPairList.class); - } - - /** - * Create or import keypair. - * - * Sending name will generate a key and return private key and fingerprint. - * - * You can send a public key to add an existing ssh key - * - * @param keyPair - * @return - */ - public KeyPair post(NovaKeyPair keyPair) { - // OSAPI bug: Can't specify an SSH key in XML? - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(keyPair, MediaType.APPLICATION_JSON), NovaKeyPair.class); - } - - public KeyPairResource keypair(String name) { - return new KeyPairResource(target.path("/{name}").pathParam("name", name), properties); - } - - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/NetworkResource.java b/src/main/java/org/openstack/api/compute/ext/NetworkResource.java deleted file mode 100644 index abf91a7ae..000000000 --- a/src/main/java/org/openstack/api/compute/ext/NetworkResource.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -/** - * Admin-only Network Management Extension - * - * @author sp - * - */ -public class NetworkResource extends Resource { - - public NetworkResource(Target target, Properties properties) { - super(target, properties); - } - - public String get() { - return target.request(MediaType.APPLICATION_JSON).get(String.class); - } - - public String delete() { - return target.request(MediaType.WILDCARD).delete(String.class); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/NetworksResource.java b/src/main/java/org/openstack/api/compute/ext/NetworksResource.java deleted file mode 100644 index 7f3260917..000000000 --- a/src/main/java/org/openstack/api/compute/ext/NetworksResource.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -/** - * Admin-only Network Management Extension - * - * @author sp - * - */ -public class NetworksResource extends Resource { - - public NetworksResource(Target target, Properties properties) { - super(target, properties); - } - - public String get() { - return target.request(MediaType.APPLICATION_JSON).get(String.class); - } - - public NetworkResource network(String id) { - return new NetworkResource(target.path("/{networkId}").pathParam("networkId", id), properties); - } -} diff --git a/src/main/java/org/openstack/api/compute/ext/QuotasResource.java b/src/main/java/org/openstack/api/compute/ext/QuotasResource.java deleted file mode 100644 index 359cf06b8..000000000 --- a/src/main/java/org/openstack/api/compute/ext/QuotasResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.quota.NovaQuotaSet; - -/** - * Quotas management support - * - * @author sp - * - */ -public class QuotasResource extends Resource { - - public QuotasResource(Target target, Properties properties) { - super(target, properties); - } - - public NovaQuotaSet get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaQuotaSet.class); - } - - public NovaQuotaSet put(NovaQuotaSet quotaSet) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(quotaSet),NovaQuotaSet.class); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/RescueResource.java b/src/main/java/org/openstack/api/compute/ext/RescueResource.java deleted file mode 100644 index e29a0da97..000000000 --- a/src/main/java/org/openstack/api/compute/ext/RescueResource.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; - -import org.openstack.api.common.Resource; - -/** - * Instance rescue mode - * - * @author sp - * - */ -public class RescueResource extends Resource { - - public RescueResource(Target target, Properties properties) { - super(target, properties); - } - - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/SecurityGroupResource.java b/src/main/java/org/openstack/api/compute/ext/SecurityGroupResource.java deleted file mode 100644 index d2b6faf57..000000000 --- a/src/main/java/org/openstack/api/compute/ext/SecurityGroupResource.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.api.compute.ext; - - -import java.util.HashMap; -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.SecurityGroup; -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroup; - -public class SecurityGroupResource extends Resource { - - public SecurityGroupResource(Target target, Properties properties) { - super(target, properties); - } - - public SecurityGroup get() { - return get(new HashMap()); - } - - public SecurityGroup get(HashMap properties) { - return target.request(MediaType.APPLICATION_JSON).get(NovaSecurityGroup.class); - } - - public void delete() { - target.request(MediaType.WILDCARD).delete(); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/SecurityGroupRuleResource.java b/src/main/java/org/openstack/api/compute/ext/SecurityGroupRuleResource.java deleted file mode 100644 index 56f7f37d0..000000000 --- a/src/main/java/org/openstack/api/compute/ext/SecurityGroupRuleResource.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -public class SecurityGroupRuleResource extends Resource { - - public SecurityGroupRuleResource(Target target, Properties properties) { - super(target, properties); - } - - public void delete() { - target.request(MediaType.WILDCARD).delete(); - } - - // This function is "missing" from the OpenStack API - // public SecurityGroupRule fetch() { - // return resource().get(SecurityGroupRule.class); - // } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/SecurityGroupRulesResource.java b/src/main/java/org/openstack/api/compute/ext/SecurityGroupRulesResource.java deleted file mode 100644 index bbabd7eb3..000000000 --- a/src/main/java/org/openstack/api/compute/ext/SecurityGroupRulesResource.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.SecurityGroupRule; -import org.openstack.model.compute.SecurityGroupRuleForCreate; -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroupRule; - -public class SecurityGroupRulesResource extends Resource { - - public SecurityGroupRulesResource(Target target, Properties properties) { - super(target, properties); - } - - public SecurityGroupRule post(SecurityGroupRuleForCreate rule) { - // OSAPI bug: Can't specify an SSH key in XML? - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(rule, MediaType.APPLICATION_JSON), NovaSecurityGroupRule.class); - } - - public SecurityGroupRuleResource rule(Integer id) { - return new SecurityGroupRuleResource(target.path("/{ruleId}").pathParam("ruleId", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/SecurityGroupsResource.java b/src/main/java/org/openstack/api/compute/ext/SecurityGroupsResource.java deleted file mode 100644 index d90a16b8d..000000000 --- a/src/main/java/org/openstack/api/compute/ext/SecurityGroupsResource.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.SecurityGroup; -import org.openstack.model.compute.SecurityGroupForCreate; -import org.openstack.model.compute.SecurityGroupList; -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroup; -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroupList; - -public class SecurityGroupsResource extends Resource { - - public SecurityGroupsResource(Target target, Properties properties) { - super(target, properties); - } - - public SecurityGroupList get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaSecurityGroupList.class); - } - - public SecurityGroup post(SecurityGroupForCreate securityGroup) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(securityGroup, MediaType.APPLICATION_JSON), NovaSecurityGroup.class); - - } - - public SecurityGroupResource securityGroup(int id) { - return new SecurityGroupResource(target.path("/{id}").pathParam("id", id), properties); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/SimpleTenantUsageResource.java b/src/main/java/org/openstack/api/compute/ext/SimpleTenantUsageResource.java deleted file mode 100644 index 51c8f8168..000000000 --- a/src/main/java/org/openstack/api/compute/ext/SimpleTenantUsageResource.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.usage.NovaSimpleTenantUsage; - -/** - * Simple tenant usage extension - * - * @author sp - * - */ -public class SimpleTenantUsageResource extends Resource { - - public SimpleTenantUsageResource(Target target, Properties properties) { - super(target, properties); - } - - public NovaSimpleTenantUsage get(String start, String end) { - Target localTarget = target.queryParam("detailed",1); - if(start != null) { - localTarget = localTarget.queryParam("start",start); - } - if(end != null) { - localTarget = localTarget.queryParam("end",end); - } - return localTarget.request(MediaType.APPLICATION_JSON).get(NovaSimpleTenantUsage.class); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/SimpleTenantUsagesResource.java b/src/main/java/org/openstack/api/compute/ext/SimpleTenantUsagesResource.java deleted file mode 100644 index 20685267b..000000000 --- a/src/main/java/org/openstack/api/compute/ext/SimpleTenantUsagesResource.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.usage.NovaSimpleTenantUsages; - -/** - * Simple tenant usage extension - * - * @author sp - * - */ -public class SimpleTenantUsagesResource extends Resource { - - public SimpleTenantUsagesResource(Target target, Properties properties) { - super(target, properties); - } - - public NovaSimpleTenantUsages get(String start, String end) { - Target localTarget = target.queryParam("detailed",1); - if(start != null) { - localTarget = localTarget.queryParam("start",start); - } - if(end != null) { - localTarget = localTarget.queryParam("end",end); - } - return localTarget.request(MediaType.APPLICATION_JSON).get(NovaSimpleTenantUsages.class); - } - - public SimpleTenantUsageResource tenant(String id) { - return new SimpleTenantUsageResource(target.path("/{tenantId}").pathParam("tenantId", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/SnapshotResource.java b/src/main/java/org/openstack/api/compute/ext/SnapshotResource.java deleted file mode 100644 index 599d7cb64..000000000 --- a/src/main/java/org/openstack/api/compute/ext/SnapshotResource.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Snapshot; -import org.openstack.model.compute.nova.snapshot.NovaSnapshot; - -public class SnapshotResource extends Resource { - - public SnapshotResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Return a single volume type item. - * - * @return - */ - public Snapshot get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaSnapshot.class); - } - - public void delete() { - target.request(MediaType.WILDCARD).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/SnapshotsResource.java b/src/main/java/org/openstack/api/compute/ext/SnapshotsResource.java deleted file mode 100644 index 4c7098b39..000000000 --- a/src/main/java/org/openstack/api/compute/ext/SnapshotsResource.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Snapshot; -import org.openstack.model.compute.SnapshotForCreate; -import org.openstack.model.compute.SnapshotList; -import org.openstack.model.compute.nova.snapshot.NovaSnapshot; -import org.openstack.model.compute.nova.snapshot.NovaSnapshotList; - -public class SnapshotsResource extends Resource { - - public SnapshotsResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Returns the list of volume types - * - * @return - */ - public SnapshotList get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaSnapshotList.class); - } - - /** - * Creates a new volume. - * - * @param flavor - * @return - */ - public Snapshot post(SnapshotForCreate volume) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(volume, MediaType.APPLICATION_JSON), NovaSnapshot.class); - } - - public SnapshotResource snapshot(String id) { - return new SnapshotResource(target.path("/{snapshotId}").pathParam("snapshotId", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/VolumeAttachmentResource.java b/src/main/java/org/openstack/api/compute/ext/VolumeAttachmentResource.java deleted file mode 100644 index 91ffa0bed..000000000 --- a/src/main/java/org/openstack/api/compute/ext/VolumeAttachmentResource.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; - -public class VolumeAttachmentResource extends Resource { - - public VolumeAttachmentResource(Target target, Properties properties) { - super(target, properties); - } - - public Response delete() { - return target.request(MediaType.WILDCARD).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/VolumeAttachmentsResource.java b/src/main/java/org/openstack/api/compute/ext/VolumeAttachmentsResource.java deleted file mode 100644 index 3579b6e9c..000000000 --- a/src/main/java/org/openstack/api/compute/ext/VolumeAttachmentsResource.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.nova.volume.NovaVolumeAttachment; - - -public class VolumeAttachmentsResource extends Resource { - - public VolumeAttachmentsResource(Target target, Properties properties) { - super(target, properties); - } - - public Response post(NovaVolumeAttachment attachment) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(attachment, MediaType.APPLICATION_JSON)); - } - - public VolumeAttachmentResource attachment(String id) { - return new VolumeAttachmentResource(target.path("/{volumeId}").pathParam("volumeId", id), properties); - } - - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/VolumeResource.java b/src/main/java/org/openstack/api/compute/ext/VolumeResource.java deleted file mode 100644 index 3a870dfb1..000000000 --- a/src/main/java/org/openstack/api/compute/ext/VolumeResource.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Volume; -import org.openstack.model.compute.nova.volume.NovaVolume; - -public class VolumeResource extends Resource { - - public VolumeResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Return a single volume type item. - * - * @return - */ - public Volume get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaVolume.class); - } - - public void delete() { - target.request(MediaType.WILDCARD).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/VolumeTypeResource.java b/src/main/java/org/openstack/api/compute/ext/VolumeTypeResource.java deleted file mode 100644 index ad4a16248..000000000 --- a/src/main/java/org/openstack/api/compute/ext/VolumeTypeResource.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -public class VolumeTypeResource extends Resource { - - // /** - // * Return a single volume type item. - // * - // * @return - // */ - // public FlavorsRepresentation show() { - // FlavorList list = client.resource(resource) - // .accept(MediaType.APPLICATION_XML).get(FlavorList.class); - // return new FlavorsRepresentation(client, list); - // } - - public VolumeTypeResource(Target target, Properties properties) { - super(target, properties); - } - - public String get() { - return target.request(MediaType.APPLICATION_JSON).get(String.class); - } - - public void delete() { - } - -} diff --git a/src/main/java/org/openstack/api/compute/ext/VolumeTypesResource.java b/src/main/java/org/openstack/api/compute/ext/VolumeTypesResource.java deleted file mode 100644 index c05542728..000000000 --- a/src/main/java/org/openstack/api/compute/ext/VolumeTypesResource.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; - -/** - * The volume types API controller for the Openstack API - * - * @author sp - * - */ -public class VolumeTypesResource extends Resource { - - public VolumeTypesResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Returns the list of volume types - * - * @return - */ - public String get(Map properties) { - return target.request(MediaType.APPLICATION_JSON).get(String.class); - } - - /** - * Creates a new volume type. - * - * @param flavor - * @return - */ -// public Flavor create(Flavor flavor) { -// return null; -// } - - -} diff --git a/src/main/java/org/openstack/api/compute/ext/VolumesResource.java b/src/main/java/org/openstack/api/compute/ext/VolumesResource.java deleted file mode 100644 index 20011e0ec..000000000 --- a/src/main/java/org/openstack/api/compute/ext/VolumesResource.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.openstack.api.compute.ext; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.compute.Volume; -import org.openstack.model.compute.VolumeList; -import org.openstack.model.compute.nova.volume.NovaVolume; -import org.openstack.model.compute.nova.volume.NovaVolumeList; -import org.openstack.model.compute.nova.volume.VolumeForCreate; - -/** - * The volume types API controller for the Openstack API - * - * @author sp - * - */ -public class VolumesResource extends Resource { - - public VolumesResource(Target target, Properties properties) { - super(target, properties); - } - - /** - * Returns the list of volume types - * - * @return - */ - public VolumeList get() { - return target.request(MediaType.APPLICATION_JSON).get(NovaVolumeList.class); - } - - /** - * Creates a new volume. - * - * @param flavor - * @return - */ - public Volume post(VolumeForCreate volume) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(volume, MediaType.APPLICATION_JSON), NovaVolume.class); - } - - public VolumeResource volume(String id) { - return new VolumeResource(target.path("/{volumeId}").pathParam("volumeId", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/compute/notavailable/AccountsResource.java b/src/main/java/org/openstack/api/compute/notavailable/AccountsResource.java deleted file mode 100644 index 6631b2405..000000000 --- a/src/main/java/org/openstack/api/compute/notavailable/AccountsResource.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.openstack.api.compute.notavailable; - -import java.util.Properties; - -import javax.ws.rs.client.Target; - -import org.openstack.api.common.Resource; - -public class AccountsResource extends Resource { - - protected AccountsResource(Target target, Properties properties) { - super(target, properties); - } - - -} diff --git a/src/main/java/org/openstack/api/compute/notavailable/UsersResource.java b/src/main/java/org/openstack/api/compute/notavailable/UsersResource.java deleted file mode 100644 index 5ca927add..000000000 --- a/src/main/java/org/openstack/api/compute/notavailable/UsersResource.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openstack.api.compute.notavailable; - -import java.util.Properties; - -import javax.ws.rs.client.Target; - -import org.openstack.api.common.Resource; - -/** - * Allow admins to acces user information - * - * @author sp - * - */ -public class UsersResource extends Resource { - - protected UsersResource(Target target, Properties properties) { - super(target, properties); - } - - -} diff --git a/src/main/java/org/openstack/api/extensions/Extension.java b/src/main/java/org/openstack/api/extensions/Extension.java deleted file mode 100644 index 396a97a85..000000000 --- a/src/main/java/org/openstack/api/extensions/Extension.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.openstack.api.extensions; - -public class Extension { - final Class attributeClass; - - public Extension(Class attributeClass) { - this.attributeClass = attributeClass; - } - - public String getXmlNamespace() { - return XmlUtils.getNamespace(attributeClass); - } - - public Class getAttributeClass() { - return attributeClass; - } - -} diff --git a/src/main/java/org/openstack/api/extensions/ExtensionHelper.java b/src/main/java/org/openstack/api/extensions/ExtensionHelper.java deleted file mode 100644 index 7dcb9bc29..000000000 --- a/src/main/java/org/openstack/api/extensions/ExtensionHelper.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.openstack.api.extensions; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.namespace.QName; - -public class ExtensionHelper { - - final Class clazz; - - public ExtensionHelper(Class clazz) { - this.clazz = clazz; - } - - public T parse(Map extensionAttributes) { - // TODO: Can JAXB can do this for us?? We could try constructing a fake document... - T o = newInstance(); - - - Field[] fields = clazz.getDeclaredFields(); - for (Field field : fields) { - XmlAttribute xmlAttribute = field.getAnnotation(XmlAttribute.class); - if (xmlAttribute == null) - continue; - - String namespaceURI = XmlUtils.getNamespace(field, xmlAttribute); - String attributeName = XmlUtils.getAttributeName(field, xmlAttribute); - QName qname = new QName(namespaceURI, attributeName); - - Object attributeValue = extensionAttributes.get(qname); - if (attributeValue == null) - continue; - - setField(o, field, attributeValue); - } - return o; - } - - private void setField(T o, Field field, Object attributeValue) { - if ((field.getModifiers() & Modifier.PUBLIC) == 0) { - if (!field.isAccessible()) { - field.setAccessible(true); - } - } - - try { - field.set(o, attributeValue); - } catch (IllegalArgumentException e) { - throw new IllegalArgumentException("Error setting field", e); - } catch (IllegalAccessException e) { - throw new IllegalArgumentException("Error setting field", e); - } - } - - private T newInstance() { - try { - return (T) clazz.newInstance(); - } catch (InstantiationException e) { - throw new IllegalArgumentException("Error building instance", e); - } catch (IllegalAccessException e) { - throw new IllegalArgumentException("Error building instance", e); - } - } - - public static ExtensionHelper build(Class clazz) { - return new ExtensionHelper(clazz); - } - -} diff --git a/src/main/java/org/openstack/api/extensions/ExtensionRegistry.java b/src/main/java/org/openstack/api/extensions/ExtensionRegistry.java deleted file mode 100644 index 3786ccb22..000000000 --- a/src/main/java/org/openstack/api/extensions/ExtensionRegistry.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.openstack.api.extensions; - -import java.util.Map; -import java.util.Set; -import java.util.logging.Logger; - -import javax.xml.namespace.QName; - -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - -public class ExtensionRegistry { - static final Logger log = Logger.getLogger(ExtensionRegistry.class.getName()); - - final Map extensionsByNamespace = Maps.newHashMap(); - - public Extension findExtensionByNamespace(String namespace) { - return extensionsByNamespace.get(namespace); - } - - public ExtensionValues parseAllExtensions(Map extensionAttributes) { - ExtensionValues results = new ExtensionValues(); - - if (extensionAttributes != null) { - Set namespaces = Sets.newHashSet(); - for (QName qname : extensionAttributes.keySet()) { - namespaces.add(qname.getNamespaceURI()); - } - - for (String namespace : namespaces) { - Extension extension = findExtensionByNamespace(namespace); - if (extension == null) { - // TODO: We could have a generic placeholder... - log.info("Ignoring unknown namespace: " + namespace); - - continue; - } - Class attributeClass = extension.getAttributeClass(); - if (attributeClass != null) { - Object o = parseExtensionAttributes(extensionAttributes, attributeClass); - results.add(o); - } - } - } - return results; - } - - private T parseExtensionAttributes(Map extensionAttributes, Class attributeClass) { - ExtensionHelper helper = new ExtensionHelper(attributeClass); - T o = helper.parse(extensionAttributes); - return o; - } - - public void add(Extension extension) { - String namespace = extension.getXmlNamespace(); - if (extensionsByNamespace.containsKey(namespace)) - throw new IllegalArgumentException("Duplicate namespace: " + namespace); - - extensionsByNamespace.put(namespace, extension); - } -} diff --git a/src/main/java/org/openstack/api/extensions/ExtensionValues.java b/src/main/java/org/openstack/api/extensions/ExtensionValues.java deleted file mode 100644 index 1457fc2a8..000000000 --- a/src/main/java/org/openstack/api/extensions/ExtensionValues.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openstack.api.extensions; - -import java.util.Map; - -import com.google.common.collect.Maps; - -public class ExtensionValues { - - final Map, Object> results = Maps.newHashMap(); - - public ExtensionValues() { - } - - @SuppressWarnings("unchecked") - public T get(Class clazz) { - return (T) results.get(clazz); - } - - public void add(Object o) { - results.put(o.getClass(), o); - } -} diff --git a/src/main/java/org/openstack/api/extensions/XmlUtils.java b/src/main/java/org/openstack/api/extensions/XmlUtils.java deleted file mode 100644 index 75078ed2e..000000000 --- a/src/main/java/org/openstack/api/extensions/XmlUtils.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.openstack.api.extensions; - -import java.lang.reflect.Field; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlSchema; -import javax.xml.bind.annotation.XmlType; - -public class XmlUtils { - public static String getAttributeName(Field field, XmlAttribute xmlAttribute) { - String name = xmlAttribute.name(); - if ("##default".equals(name)) { - name = null; - } - - if (name == null) { - name = field.getName(); - } - - return name; - } - - public static String getNamespace(Class clazz) { - XmlType xmlType = clazz.getAnnotation(XmlType.class); - - String namespace = null; - - if (xmlType != null) { - namespace = xmlType.namespace(); - if ("##default".equals(namespace)) { - namespace = null; - } - } - - if (namespace == null) { - Package itemPackage = clazz.getPackage(); - XmlSchema xmlSchema = itemPackage.getAnnotation(XmlSchema.class); - if (xmlSchema != null) { - namespace = xmlSchema.namespace(); - } - } - - return namespace; - } - - public static String getNamespace(Field field, XmlAttribute xmlAttribute) { - String namespace = xmlAttribute.namespace(); - if ("##default".equals(namespace)) { - namespace = null; - } - - if (namespace == null) { - namespace = getNamespace(field.getDeclaringClass()); - } - - return namespace; - } - -} diff --git a/src/main/java/org/openstack/api/identity/IdentityAdministrationEndpoint.java b/src/main/java/org/openstack/api/identity/IdentityAdministrationEndpoint.java deleted file mode 100644 index f76acfe3c..000000000 --- a/src/main/java/org/openstack/api/identity/IdentityAdministrationEndpoint.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openstack.api.identity; - -import java.util.Properties; -import java.util.logging.Logger; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.Target; - -import org.glassfish.jersey.filter.LoggingFilter; -import org.openstack.api.common.Resource; -import org.openstack.api.identity.admin.resources.EndpointsResource; -import org.openstack.api.identity.admin.resources.RolesResource; -import org.openstack.api.identity.admin.resources.ServicesResource; -import org.openstack.api.identity.admin.resources.TenantsResource; -import org.openstack.api.identity.admin.resources.TokensResource; -import org.openstack.api.identity.admin.resources.UsersResource; - -public class IdentityAdministrationEndpoint extends Resource { - - private LoggingFilter loggingFilter = new LoggingFilter(Logger.getLogger(IdentityAdministrationEndpoint.class.getPackage().getName()),true); - - public IdentityAdministrationEndpoint(Target target, Properties properties) { - super(target, properties); - if(Boolean.parseBoolean(properties.getProperty("verbose"))) { - target.configuration().register(loggingFilter); - } - } - - public static IdentityAdministrationEndpoint endpoint(Client client, String endpoint, Properties properties) { - return new IdentityAdministrationEndpoint(client.target(endpoint), properties); - } - - public TokensResource tokens() { - return path("/tokens", TokensResource.class); - } - - public TenantsResource tenants() { - return path("/tenants", TenantsResource.class); - } - - public UsersResource users() { - return path("/users", UsersResource.class); - } - - public RolesResource roles() { - return path("/OS-KSADM/roles", RolesResource.class); - } - - public ServicesResource services() { - return path("/OS-KSADM/services", ServicesResource.class); - } - - public EndpointsResource endpoints() { - return path("/endpoints", EndpointsResource.class); - } - -} diff --git a/src/main/java/org/openstack/api/identity/IdentityInternalEndpoint.java b/src/main/java/org/openstack/api/identity/IdentityInternalEndpoint.java deleted file mode 100644 index e1294b6a8..000000000 --- a/src/main/java/org/openstack/api/identity/IdentityInternalEndpoint.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.openstack.api.identity; - -import java.util.Properties; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.Target; - -public class IdentityInternalEndpoint extends IdentityPublicEndpoint { - - public IdentityInternalEndpoint(Target target, Properties properties) { - super(target, properties); - } - - public static IdentityInternalEndpoint endpoint(Client client, String endpoint, Properties properties) { - return new IdentityInternalEndpoint(client.target(endpoint), properties); - } - -} diff --git a/src/main/java/org/openstack/api/identity/IdentityPublicEndpoint.java b/src/main/java/org/openstack/api/identity/IdentityPublicEndpoint.java deleted file mode 100644 index 7782a4860..000000000 --- a/src/main/java/org/openstack/api/identity/IdentityPublicEndpoint.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openstack.api.identity; - -import java.util.Properties; -import java.util.logging.Logger; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.Target; - -import org.glassfish.jersey.filter.LoggingFilter; -import org.openstack.api.common.Resource; -import org.openstack.api.compute.TenantResource; -import org.openstack.api.identity.resources.TenantsResource; -import org.openstack.api.identity.resources.TokensResource; - -public class IdentityPublicEndpoint extends Resource { - - private LoggingFilter loggingFilter = new LoggingFilter(Logger.getLogger(TenantResource.class.getPackage().getName()),true); - - public IdentityPublicEndpoint(Target target, Properties properties) { - super(target, properties); - if(Boolean.parseBoolean(properties.getProperty("verbose"))) { - target.configuration().register(loggingFilter); - } - } - - public static IdentityPublicEndpoint endpoint(Client client, String endpoint, Properties properties) { - return new IdentityPublicEndpoint(client.target(endpoint), properties); - } - - public TokensResource tokens() { - return path("/tokens", TokensResource.class); - } - - public TenantsResource tenants() { - return path("/tenants", TenantsResource.class); - } - -} diff --git a/src/main/java/org/openstack/api/identity/JaxbContextResolver.java b/src/main/java/org/openstack/api/identity/JaxbContextResolver.java deleted file mode 100644 index a58804217..000000000 --- a/src/main/java/org/openstack/api/identity/JaxbContextResolver.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.openstack.api.identity; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import javax.ws.rs.ext.ContextResolver; -import javax.xml.bind.JAXBContext; - -import org.openstack.model.identity.keystone.KeystoneAccess; -import org.openstack.model.identity.keystone.KeystoneAuthentication; -import org.openstack.model.identity.keystone.KeystoneEndpoint; -import org.openstack.model.identity.keystone.KeystoneEndpointList; -import org.openstack.model.identity.keystone.KeystoneRole; -import org.openstack.model.identity.keystone.KeystoneRoleList; -import org.openstack.model.identity.keystone.KeystoneService; -import org.openstack.model.identity.keystone.KeystoneServiceEndpoint; -import org.openstack.model.identity.keystone.KeystoneServiceList; -import org.openstack.model.identity.keystone.KeystoneTenant; -import org.openstack.model.identity.keystone.KeystoneTenantList; -import org.openstack.model.identity.keystone.KeystoneToken; -import org.openstack.model.identity.keystone.KeystoneUser; -import org.openstack.model.identity.keystone.KeystoneUserList; - -public class JaxbContextResolver implements ContextResolver { - - private final JAXBContext context; - private final Set> types; - private final Class[] cTypes = { - KeystoneAccess.class, KeystoneAuthentication.class, - KeystoneEndpoint.class, KeystoneEndpointList.class, - KeystoneRole.class, KeystoneRoleList.class, - KeystoneService.class, KeystoneServiceList.class, - KeystoneServiceEndpoint.class, KeystoneServiceList.class, - KeystoneTenant.class, KeystoneTenantList.class, - KeystoneToken.class, KeystoneUser.class, - KeystoneUserList.class}; - - public JaxbContextResolver() throws Exception { - this.types = new HashSet>(Arrays.asList(cTypes)); - this.context = JAXBContext.newInstance(cTypes); - } - - @Override - public JAXBContext getContext(Class type) { - return (types.contains(type)) ? context : null; - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/EndpointResource.java b/src/main/java/org/openstack/api/identity/admin/resources/EndpointResource.java deleted file mode 100644 index 0f809f810..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/EndpointResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Endpoint; -import org.openstack.model.identity.keystone.KeystoneEndpoint; - -public class EndpointResource extends Resource { - - public EndpointResource(Target target, Properties properties) { - super(target, properties); - } - - public Endpoint get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneEndpoint.class); - } - - public Endpoint update(Entity entity) { - return target.request(MediaType.APPLICATION_JSON).put(entity, KeystoneEndpoint.class); - } - - public Response delete() { - return target.request(MediaType.APPLICATION_JSON).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/EndpointsResource.java b/src/main/java/org/openstack/api/identity/admin/resources/EndpointsResource.java deleted file mode 100644 index f8349f64c..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/EndpointsResource.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Endpoint; -import org.openstack.model.identity.EndpointList; -import org.openstack.model.identity.keystone.KeystoneEndpoint; -import org.openstack.model.identity.keystone.KeystoneEndpointList; - -public class EndpointsResource extends Resource { - - public EndpointsResource(Target target, Properties properties) { - super(target, properties); - } - - public EndpointList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneEndpointList.class); - } - - public Endpoint post(Endpoint endpoint) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.entity(endpoint, MediaType.APPLICATION_JSON), KeystoneEndpoint.class); - } - - public EndpointResource endpoint(String id) { - return new EndpointResource(target.path("/{id}").pathParam("id", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/RoleResource.java b/src/main/java/org/openstack/api/identity/admin/resources/RoleResource.java deleted file mode 100644 index 3e64cc30c..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/RoleResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Role; -import org.openstack.model.identity.keystone.KeystoneRole; - -public class RoleResource extends Resource { - - public RoleResource(Target target, Properties properties) { - super(target, properties); - } - - public KeystoneRole get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneRole.class); - } - - public Role put(Role role) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(role), KeystoneRole.class); - } - - public Response delete() { - return target.request(MediaType.APPLICATION_JSON).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/RolesResource.java b/src/main/java/org/openstack/api/identity/admin/resources/RolesResource.java deleted file mode 100644 index 911e11c9c..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/RolesResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.api.identity.admin.resources; -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Role; -import org.openstack.model.identity.RoleList; -import org.openstack.model.identity.keystone.KeystoneRole; -import org.openstack.model.identity.keystone.KeystoneRoleList; - -public class RolesResource extends Resource { - - public RolesResource(Target target, Properties properties) { - super(target, properties); - } - - public RoleList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneRoleList.class); - } - - public Role post(Role role) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.json(role), KeystoneRole.class); - } - - public RoleResource role(String id) { - return new RoleResource(target.path("/{id}").pathParam("id", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/ServiceResource.java b/src/main/java/org/openstack/api/identity/admin/resources/ServiceResource.java deleted file mode 100644 index 41f9f2203..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/ServiceResource.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Service; -import org.openstack.model.identity.keystone.KeystoneService; - -public class ServiceResource extends Resource { - - public ServiceResource(Target target, Properties properties) { - super(target, properties); - } - - - public KeystoneService get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneService.class); - } - - public Service update(Entity entity) { - return target.request(MediaType.APPLICATION_JSON).put(entity, KeystoneService.class); - } - - public Response delete() { - return target.request(MediaType.APPLICATION_JSON).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/ServicesResource.java b/src/main/java/org/openstack/api/identity/admin/resources/ServicesResource.java deleted file mode 100644 index 896c31fd5..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/ServicesResource.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Service; -import org.openstack.model.identity.ServiceList; -import org.openstack.model.identity.keystone.KeystoneService; -import org.openstack.model.identity.keystone.KeystoneServiceList; - -public class ServicesResource extends Resource { - - public ServicesResource(Target target, Properties properties) { - super(target, properties); - } - - public ServiceList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneServiceList.class); - } - - public Service post(Service service) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.json(service), KeystoneService.class); - } - - public ServiceResource service(String id) { - return new ServiceResource(target.path("/{id}").pathParam("id", id), properties); - } - - - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/TenantResource.java b/src/main/java/org/openstack/api/identity/admin/resources/TenantResource.java deleted file mode 100644 index b276d428e..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/TenantResource.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Tenant; -import org.openstack.model.identity.keystone.KeystoneTenant; - -public class TenantResource extends Resource { - - public TenantResource(Target target, Properties properties) { - super(target, properties); - } - - public KeystoneTenant get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneTenant.class); - } - - public Tenant update(Entity entity) { - return target.request(MediaType.APPLICATION_JSON).put(entity, KeystoneTenant.class); - } - - public Response delete() { - return target.request(MediaType.APPLICATION_JSON).delete(); - } - - public TenantUsersResource users() { - return path("users", TenantUsersResource.class); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/TenantUserResource.java b/src/main/java/org/openstack/api/identity/admin/resources/TenantUserResource.java deleted file mode 100644 index 4b0517d87..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/TenantUserResource.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Target; - -import org.openstack.api.common.Resource; - -public class TenantUserResource extends Resource { - - protected TenantUserResource(Target target, Properties properties) { - super(target, properties); - } - - public TenantUserRolesResource roles() { - //return path("/roles/OS-KSADM", TenantUserRolesResource.class); - return path("/roles", TenantUserRolesResource.class); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/TenantUserRoleResource.java b/src/main/java/org/openstack/api/identity/admin/resources/TenantUserRoleResource.java deleted file mode 100644 index 5af756560..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/TenantUserRoleResource.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Role; -import org.openstack.model.identity.keystone.KeystoneRole; - -public class TenantUserRoleResource extends Resource { - - public TenantUserRoleResource(Target target, Properties properties) { - super(target, properties); - } - - public Role put() { - return target.request(MediaType.APPLICATION_JSON).method("PUT", KeystoneRole.class); - } - - public Response delete() { - return target.request(MediaType.APPLICATION_JSON).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/TenantUserRolesResource.java b/src/main/java/org/openstack/api/identity/admin/resources/TenantUserRolesResource.java deleted file mode 100644 index efbcb0e21..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/TenantUserRolesResource.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.RoleList; -import org.openstack.model.identity.keystone.KeystoneRoleList; - -public class TenantUserRolesResource extends Resource { - - public TenantUserRolesResource(Target target, Properties properties) { - super(target, properties); - } - - public RoleList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneRoleList.class); - } - - public TenantUserRoleResource role(String id) { - return new TenantUserRoleResource(target.path("/OS-KSADM/{roleId}").pathParam("roleId", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/TenantUsersResource.java b/src/main/java/org/openstack/api/identity/admin/resources/TenantUsersResource.java deleted file mode 100644 index 8df7c20ca..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/TenantUsersResource.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.UserList; -import org.openstack.model.identity.keystone.KeystoneUserList; - -public class TenantUsersResource extends Resource { - - public TenantUsersResource(Target target, Properties properties) { - super(target, properties); - } - - public UserList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneUserList.class); - - } - - public TenantUserResource user(String id) { - return new TenantUserResource(target.path("/{userId}").pathParam("userId", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/TenantsResource.java b/src/main/java/org/openstack/api/identity/admin/resources/TenantsResource.java deleted file mode 100644 index f0dea9012..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/TenantsResource.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Tenant; -import org.openstack.model.identity.TenantList; -import org.openstack.model.identity.keystone.KeystoneTenant; -import org.openstack.model.identity.keystone.KeystoneTenantList; - -public class TenantsResource extends Resource { - - public TenantsResource(Target target, Properties properties) { - super(target, properties); - } - - public TenantList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneTenantList.class); - } - - public Tenant post(Tenant tenant) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.json(tenant), KeystoneTenant.class); - } - - public TenantResource tenant(String id) { - return new TenantResource(target.path("/{tenantId}").pathParam("tenantId", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/TokenResource.java b/src/main/java/org/openstack/api/identity/admin/resources/TokenResource.java deleted file mode 100644 index 1b3051683..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/TokenResource.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Access; -import org.openstack.model.identity.keystone.KeystoneAccess; - -public class TokenResource extends Resource { - - public TokenResource(Target target, Properties properties) { - super(target, properties); - } - - public KeystoneAccess get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneAccess.class); - } - - public Access update(Entity entity) { - return target.request(MediaType.APPLICATION_JSON).put(entity, KeystoneAccess.class); - } - - public Response delete() { - return target.request(MediaType.APPLICATION_JSON).delete(); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/TokensResource.java b/src/main/java/org/openstack/api/identity/admin/resources/TokensResource.java deleted file mode 100644 index 689ecf080..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/TokensResource.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Access; -import org.openstack.model.identity.Authentication; -import org.openstack.model.identity.keystone.KeystoneAccess; - -public class TokensResource extends Resource { - - public TokensResource(Target target, Properties properties) { - super(target, properties); - } - - public Access post(Authentication authentication) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.json(authentication), KeystoneAccess.class); - } - - public TokenResource token(String id) { - return new TokenResource(target.path("/{tokenId}").pathParam("tokenId", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/UserResource.java b/src/main/java/org/openstack/api/identity/admin/resources/UserResource.java deleted file mode 100644 index a0516977f..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/UserResource.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.User; -import org.openstack.model.identity.keystone.KeystoneUser; - -public class UserResource extends Resource { - - public UserResource(Target target, Properties properties) { - super(target, properties); - } - - public KeystoneUser get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneUser.class); - } - - public User post(User entity) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(entity), KeystoneUser.class); - } - - public User put(User entity) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(entity), KeystoneUser.class); - } - - public Response delete() { - return target.request().delete(); - } - - public User password(User user) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(user), KeystoneUser.class); - - } - - public User tenant(User user) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(user), KeystoneUser.class); - - } - - public User enabled(User user) { - return target.request(MediaType.APPLICATION_JSON).put(Entity.json(user), KeystoneUser.class); - - } - - public UserRolesResource roles() { - return path("roles", UserRolesResource.class); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/UserRolesResource.java b/src/main/java/org/openstack/api/identity/admin/resources/UserRolesResource.java deleted file mode 100644 index d98252134..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/UserRolesResource.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.api.identity.admin.resources; -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.RoleList; -import org.openstack.model.identity.keystone.KeystoneRoleList; - -public class UserRolesResource extends Resource { - - public UserRolesResource(Target target, Properties properties) { - super(target, properties); - } - - public RoleList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneRoleList.class); - } - -} diff --git a/src/main/java/org/openstack/api/identity/admin/resources/UsersResource.java b/src/main/java/org/openstack/api/identity/admin/resources/UsersResource.java deleted file mode 100644 index d4043d93c..000000000 --- a/src/main/java/org/openstack/api/identity/admin/resources/UsersResource.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openstack.api.identity.admin.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.User; -import org.openstack.model.identity.UserForCreate; -import org.openstack.model.identity.UserList; -import org.openstack.model.identity.keystone.KeystoneUser; -import org.openstack.model.identity.keystone.KeystoneUserList; - -public class UsersResource extends Resource { - - public UsersResource(Target target, Properties properties) { - super(target, properties); - } - - public UserList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneUserList.class); - } - - public User post(UserForCreate user) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.json(user), KeystoneUser.class); - } - - public UserResource user(String id) { - return new UserResource(target.path("/{id}").pathParam("id", id), properties); - } - -} diff --git a/src/main/java/org/openstack/api/identity/resources/TenantsResource.java b/src/main/java/org/openstack/api/identity/resources/TenantsResource.java deleted file mode 100644 index 25cc0d0fb..000000000 --- a/src/main/java/org/openstack/api/identity/resources/TenantsResource.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openstack.api.identity.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.TenantList; -import org.openstack.model.identity.keystone.KeystoneTenantList; - -public class TenantsResource extends Resource { - - public TenantsResource(Target target, Properties properties) { - super(target, properties); - } - - public TenantList get() { - return target.request(MediaType.APPLICATION_JSON).get(KeystoneTenantList.class); - } - -} diff --git a/src/main/java/org/openstack/api/identity/resources/TokensResource.java b/src/main/java/org/openstack/api/identity/resources/TokensResource.java deleted file mode 100644 index bd7aacef7..000000000 --- a/src/main/java/org/openstack/api/identity/resources/TokensResource.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.openstack.api.identity.resources; - -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.openstack.api.common.Resource; -import org.openstack.model.identity.Access; -import org.openstack.model.identity.Authentication; -import org.openstack.model.identity.keystone.KeystoneAccess; - -public class TokensResource extends Resource { - - public TokensResource(Target target, Properties properties) { - super(target, properties); - } - - public Access post(Authentication authentication) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.json(authentication), KeystoneAccess.class); - } - - public T post(Authentication authentication, Class type) { - return target.request(MediaType.APPLICATION_JSON).post(Entity.json(authentication), type); - } - -} diff --git a/src/main/java/org/openstack/api/images/GlanceHeaderUtils.java b/src/main/java/org/openstack/api/images/GlanceHeaderUtils.java deleted file mode 100644 index 4547f9663..000000000 --- a/src/main/java/org/openstack/api/images/GlanceHeaderUtils.java +++ /dev/null @@ -1,166 +0,0 @@ -package org.openstack.api.images; - -import java.lang.reflect.Field; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TimeZone; -import java.util.logging.Logger; - -import javax.ws.rs.client.Invocation; -import javax.ws.rs.core.ResponseHeaders; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.openstack.model.images.Image; -import org.openstack.model.images.glance.GlanceImage; - -import com.google.common.collect.Maps; - -class GlanceHeaderUtils { - static final Logger log = Logger.getLogger(GlanceHeaderUtils.class.getName()); - - static Invocation.Builder setHeadersForProperties(Invocation.Builder builder, Map metadata) { - for (Map.Entry tag : metadata.entrySet()) { - builder = builder.header("x-image-meta-property-" + tag.getKey(), tag.getValue().toString()); - } - return builder; - } - - static Invocation.Builder setHeaders(Invocation.Builder builder, Image properties) { - if (properties.getName() != null) { - builder = builder.header("x-image-meta-name", properties.getName()); - } else { - // throw new IllegalArgumentException("Name is required"); - } - - if (properties.getId() != null) { - builder = builder.header("x-image-meta-id", properties.getName()); - } - - // x-image-meta-store - // This header is optional. Valid values are one of file, s3, or swift - // When present, Glance will attempt to store the disk image data in the backing store indicated by the value of the header. If the Glance node does not support the backing store, Glance will - // return a 400 Bad Request. - // When not present, Glance will store the disk image data in the backing store that is marked default. See the configuration option default_store for more information. - - if (properties.getDiskFormat() != null) { - builder = builder.header("x-image-meta-disk-format", properties.getDiskFormat()); - } - if (properties.getContainerFormat() != null) { - builder = builder.header("x-image-meta-container-format", properties.getContainerFormat()); - } - - if (properties.getSize() != null) { - builder = builder.header("x-image-meta-size", properties.getSize().toString()); - } - - if (properties.getChecksum() != null) { - builder = builder.header("x-image-meta-checksum", properties.getChecksum()); - } - - if (properties.isPublic() != null) { - builder = builder.header("x-image-meta-is-public", properties.isPublic().toString()); - } - - if (properties.getMinRam() != null) { - builder = builder.header("x-image-meta-min-ram", properties.getMinRam().toString()); - } - - if (properties.getMinDisk() != null) { - builder = builder.header("x-image-meta-min-disk", properties.getMinDisk().toString()); - } - - if (properties.getOwner() != null) { - builder = builder.header("x-image-meta-owner", properties.getOwner()); - } - - return setHeadersForProperties(builder, properties.getProperties()); - } - - static Map imageFieldMap; - - static Map getImageFieldMap() { - if (imageFieldMap == null) { - Map map = Maps.newHashMap(); - for (Field field : GlanceImage.class.getDeclaredFields()) { - JsonProperty jsonProperty = field.getAnnotation(JsonProperty.class); - if(jsonProperty != null) { - String name = jsonProperty.value(); - field.setAccessible(true); - map.put(name, field); - } - } - imageFieldMap = map; - } - return imageFieldMap; - } - - public static Image unmarshalHeaders(ResponseHeaders response) { - Image image = new GlanceImage(); - for (Entry> entry : response.asMap().entrySet()) { - String key = entry.getKey(); - List values = entry.getValue(); - if (values.size() != 1) { - throw new IllegalStateException(); - } - String value = values.get(0); - key = key.toLowerCase(); - - Map imageFieldMap = getImageFieldMap(); - - String USER_PROPERTY_PREFIX = "x-image-meta-property-"; - String SYSTEM_PROPERTY_PREFIX = "x-image-meta-"; - if (key.startsWith(USER_PROPERTY_PREFIX)) { - String name = key.substring(USER_PROPERTY_PREFIX.length()); - image.getProperties().put(name, value); - } else if (key.startsWith(SYSTEM_PROPERTY_PREFIX)) { - String name = key.substring(SYSTEM_PROPERTY_PREFIX.length()); - Field field = imageFieldMap.get(name); - if (field == null) - throw new IllegalStateException("Unknown header: " + key); - - setField(image, field, value); - } else if (key.equals("location")) { - if (image.getUri() != null) - throw new IllegalStateException(); - image.setUri(value); - } else { - log.fine("Ignoring unknown header " + key); - } - } - return image; - } - - private static void setField(Object target, Field field, String value) { - Object fieldValue = value; - try { - Class fieldType = field.getType(); - if (value.isEmpty()) { - // It's questionable as to whether we should map the empty string to null - // https://bugs.launchpad.net/glance/+bug/933702 - fieldValue = null; - } else if (fieldType == Date.class) { - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); - format.setTimeZone(TimeZone.getTimeZone("UTC")); - try { - fieldValue = format.parse(value); - } catch (ParseException e) { - throw new IllegalArgumentException("Unable to parse date value: " + value); - } - } else if (fieldType == Integer.class) { - fieldValue = Integer.valueOf(value); - } else if (fieldType == Long.class) { - fieldValue = Long.valueOf(value); - } else if (fieldType == Boolean.class) { - fieldValue = Boolean.valueOf(value); - } - field.set(target, fieldValue); - } catch (IllegalAccessException e) { - throw new IllegalArgumentException("Error setting field: " + field, e); - } - } -} diff --git a/src/main/java/org/openstack/api/images/ImageResource.java b/src/main/java/org/openstack/api/images/ImageResource.java deleted file mode 100644 index 3b6b966c7..000000000 --- a/src/main/java/org/openstack/api/images/ImageResource.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.openstack.api.images; - -import java.io.InputStream; -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Invocation.Builder; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.exceptions.OpenStackException; -import org.openstack.model.images.Image; - -public class ImageResource extends Resource { - - public ImageResource(Target target, Properties properties) { - super(target, properties); - } - - public void put(Map metadata) { - Builder b = target.request(MediaType.APPLICATION_JSON); - b = GlanceHeaderUtils.setHeadersForProperties(b, metadata); - b.method("PUT"); - } - - public Image head() throws OpenStackException { - Response response = target.request().head(); - Image image = GlanceHeaderUtils.unmarshalHeaders(response.getHeaders()); - return image; - } - - public InputStream openStream() { - return target.request().get(InputStream.class); - } - - public Response delete() { - return target.request().delete(); - } - -} diff --git a/src/main/java/org/openstack/api/images/ImagesResource.java b/src/main/java/org/openstack/api/images/ImagesResource.java deleted file mode 100644 index b41a987e5..000000000 --- a/src/main/java/org/openstack/api/images/ImagesResource.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.openstack.api.images; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; -import java.util.logging.Logger; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation.Builder; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; - -import org.apache.commons.io.IOUtils; -import org.glassfish.jersey.filter.LoggingFilter; -import org.openstack.api.common.Resource; -import org.openstack.model.exceptions.OpenStackException; -import org.openstack.model.images.Image; -import org.openstack.model.images.ImageList; -import org.openstack.model.images.glance.GlanceImage; -import org.openstack.model.images.glance.GlanceImageList; - -public class ImagesResource extends Resource { - - private LoggingFilter loggingFilter = new LoggingFilter(Logger.getLogger(ImagesResource.class.getPackage().getName()),false); - - public ImagesResource(Target target, Properties properties) { - super(target, properties); - if(Boolean.parseBoolean(properties.getProperty("verbose"))) { - target.configuration().register(loggingFilter); - } - } - - public ImageList get() { - return target.path("/detail").request(MediaType.APPLICATION_JSON).get(GlanceImageList.class); - } - - public ImageResource image(String id) { - return new ImageResource(target.path("/{id}").pathParam("id", id), properties); - } - - public Image post(File imageFile, Image imageProperties) throws IOException, OpenStackException { - FileInputStream fis = new FileInputStream(imageFile); - try { - - return post(fis, imageFile.length(), imageProperties); - } finally { - IOUtils.closeQuietly(fis); - } - } - - public Image post(InputStream imageStream, long size, Image imageProperties) throws OpenStackException, IOException { - - Builder b = target.request(MediaType.APPLICATION_JSON); - byte[] bytes = IOUtils.toByteArray(imageStream); - imageProperties.setSize((long) bytes.length); - - GlanceHeaderUtils.setHeaders(b, imageProperties); - - - return b.post(Entity.entity(bytes, MediaType.APPLICATION_OCTET_STREAM_TYPE), GlanceImage.class); - } - - - -} diff --git a/src/main/java/org/openstack/api/storage/AccountResource.java b/src/main/java/org/openstack/api/storage/AccountResource.java deleted file mode 100644 index 890e28006..000000000 --- a/src/main/java/org/openstack/api/storage/AccountResource.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.openstack.api.storage; - -import java.util.List; -import java.util.Properties; -import java.util.logging.Logger; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.glassfish.jersey.filter.LoggingFilter; -import org.openstack.api.common.Resource; -import org.openstack.api.compute.TenantResource; -import org.openstack.model.storage.StorageContainer; -import org.openstack.model.storage.swift.SwiftContainer; - -public class AccountResource extends Resource { - - // GET /account List containers - // HEAD account Retrieve account metadata - - private LoggingFilter loggingFilter = new LoggingFilter(Logger.getLogger(TenantResource.class.getPackage().getName()),true); - - - public AccountResource(Target target, Properties properties) { - super(target, properties); - if(Boolean.parseBoolean(properties.getProperty("verbose"))) { - target.configuration().register(loggingFilter); - } - } - - public List get() { - return (List) (List) target.request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); - } - - public Response head() { - return target.request().head(); - } - - public ContainerResource container(String id) { - return new ContainerResource(target.path("/{id}").pathParam("id", id), properties); - } - - public Response post() { - return target.request().post(null); - } - -} diff --git a/src/main/java/org/openstack/api/storage/ContainerResource.java b/src/main/java/org/openstack/api/storage/ContainerResource.java deleted file mode 100644 index 97ae1cacf..000000000 --- a/src/main/java/org/openstack/api/storage/ContainerResource.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.openstack.api.storage; - -import java.util.List; -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.model.storage.swift.SwiftStorageObject; - - -public class ContainerResource extends Resource { - - // Verb URI Description - // GET /account/container List objects - // PUT /account/container Create container - // DELETE /account/container Delete container - // HEAD /account/container Retrieve container metadata - - public ContainerResource(Target target, Properties properties) { - super(target, properties); - } - - //public List get() { - // return target.request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); - //} - - public List get() { - return get(null, null); - } - - public List get(String prefix, String delimiter) { - if(prefix != null) { - target = target.queryParam("prefix", prefix); - } - if(delimiter != null) { - target = target.queryParam("delimiter", delimiter); - } - return target.request(MediaType.APPLICATION_JSON).get(new GenericType>() {}); - } - - /* - public List get(String prefix, String delimiter) { - - Builder b = target.request(); - - - if (prefix != null) { - //this.target = b.addQueryParameter("prefix", prefix); - } - if (!Strings.isNullOrEmpty(delimiter)) { - //b.addQueryParameter("delimiter", delimiter); - } - - //b.clearAcceptTypes(); - //b.addAcceptType(MediaType.TEXT_PLAIN_TYPE); - - //String listing = requestBuilder.get(String.class); - String listing = ""; - List list = Lists.newArrayList(); - for (String line : Splitter.on("\n").split(listing)) { - if (line.isEmpty()) - continue; - - SwiftStorageObject storageObject = new SwiftStorageObject(); - storageObject.setName(line); - list.add(storageObject); - } - - return list; - } - */ - - public Response put() { - return target.request(MediaType.APPLICATION_JSON).method("PUT"); - } - - public Response head() { - return target.request(MediaType.APPLICATION_JSON).method("HEAD"); - } - - public Response delete() { - return target.request().method("DELETE"); - } - - public void post() { - // TODO Auto-generated method stub - - } - - public ObjectResource object(String name) { - return new ObjectResource(target.path("/{name}").pathParam("name", name), properties); - } - - - -} diff --git a/src/main/java/org/openstack/api/storage/ObjectResource.java b/src/main/java/org/openstack/api/storage/ObjectResource.java deleted file mode 100644 index 43308d6ee..000000000 --- a/src/main/java/org/openstack/api/storage/ObjectResource.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.openstack.api.storage; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.Target; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.openstack.api.common.Resource; -import org.openstack.api.identity.admin.resources.TenantResource; -import org.openstack.model.exceptions.OpenStackException; -import org.openstack.model.storage.StorageObjectProperties; - -import com.google.common.base.Preconditions; - -public class ObjectResource extends Resource { - - // Storage Objects - // Verb URI Description - // GET /account/container/object Retrieve object - // PUT /account/container/object Create/Update Object - // PUT /account/container/object Chunked transfer encoding - // DELETE /account/container/object Delete container - // HEAD /account/container/object Retrieve object metadata - // POST /account/container/object Update object metadata - - private TenantResource t = null; //new TenantResource(); - - - public ObjectResource(Target target, Properties properties) { - super(target, properties); - } - - public StorageObjectProperties head() { - Response response = target.request(MediaType.APPLICATION_JSON).head(); - StorageObjectProperties properties = SwiftHeaderUtils.unmarshalHeaders(response.getHeaders()); - return properties; - } - - public Response post(Properties properties) { - Preconditions.checkNotNull(properties, "You have to supply properties"); - Invocation.Builder b = target.request(MediaType.APPLICATION_JSON); - for(String name : properties.stringPropertyNames()) { - b = b.header("x-object-meta-" + name, properties.getProperty(name)); - } - return b.method("POST"); - } - - public Response delete() { - return target.request(MediaType.WILDCARD).delete(); - } - - public T get(Class c) { - return target.request(MediaType.WILDCARD).get(c); - } - - public Response put() throws OpenStackException { - Invocation.Builder builder = target.request(); - builder = builder.header("Content-Length", 0); - return builder.put(Entity.entity(new byte[1],"application/directory")); - } - - public Response put(InputStream is, Map headers) throws OpenStackException { - Invocation.Builder builder = target.request(MediaType.WILDCARD); - if(headers != null) { - for(Map.Entry entry : headers.entrySet()) { - builder = builder.header("x-object-meta-"+entry.getKey(), entry.getValue()); - } - } - long start = System.currentTimeMillis(); - Response response = builder.put(Entity.entity(is, MediaType.APPLICATION_OCTET_STREAM)); - long end = System.currentTimeMillis(); - System.out.println("TIME : " + (end - start)); - return response; - /* - try { - Map swiftHeaders = new HashMap(); - for(Map.Entry entry : headers.entrySet()) { - swiftHeaders.put("x-object-meta-"+entry.getKey(), entry.getValue()); - } - swiftHeaders.put("X-Auth-Token", properties.getProperty("auth.token")); - HttpUtils.upload("PUT", target.getUri().toURL(), swiftHeaders, is); - return null; - } catch (IOException e) { - throw new OpenStackException(e.getMessage(), e); - } - */ - } - - public Response put(File file, Map headers) throws OpenStackException { - try { - return put(new FileInputStream(file), headers); - } catch (IOException e) { - throw new OpenStackException(e.getMessage(), e); - } - - } - - public Response put(File file) throws OpenStackException { - return put(file, null); - } - - public Response put(InputStream objectStream) { - return put(objectStream, null); - } - -} diff --git a/src/main/java/org/openstack/api/storage/SwiftHeaderUtils.java b/src/main/java/org/openstack/api/storage/SwiftHeaderUtils.java deleted file mode 100644 index a87a255d5..000000000 --- a/src/main/java/org/openstack/api/storage/SwiftHeaderUtils.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.openstack.api.storage; - -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.logging.Logger; - -import javax.ws.rs.core.ResponseHeaders; - -import org.openstack.model.storage.StorageObjectProperties; -import org.openstack.model.storage.swift.SwiftStorageObjectProperties; - -class SwiftHeaderUtils { - - static final Logger log = Logger.getLogger(SwiftHeaderUtils.class.getName()); - - - public static StorageObjectProperties unmarshalHeaders(ResponseHeaders response) { - - StorageObjectProperties properties = new SwiftStorageObjectProperties(); - - Map userProperties = properties.getCustomProperties(); - - for (Entry> entry : response.asMap().entrySet()) { - String key = entry.getKey(); - List values = entry.getValue(); - if (values.size() != 1) { - throw new IllegalStateException(); - } - String value = values.get(0); - key = key.toLowerCase(); - - String USER_PROPERTY_PREFIX = "x-object-meta-"; - if (key.startsWith(USER_PROPERTY_PREFIX)) { - String name = key.substring(USER_PROPERTY_PREFIX.length()); - userProperties.put(name, value); - } else { - - } - } - - return properties; - } - - /* - public static Invocation.Builder setHeadersForProperties(Invocation.Builder builder, StorageObjectProperties changeProperties) { - - for (Map.Entry tag : changeProperties.getCustomProperties().entrySet()) { - - } - return builder; - } - */ - -} diff --git a/src/main/java/org/openstack/client/ComputeClient.java b/src/main/java/org/openstack/client/ComputeClient.java deleted file mode 100644 index 75500cf26..000000000 --- a/src/main/java/org/openstack/client/ComputeClient.java +++ /dev/null @@ -1,198 +0,0 @@ -package org.openstack.client; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import org.openstack.api.compute.TenantResource; -import org.openstack.model.compute.Flavor; -import org.openstack.model.compute.FlavorList; -import org.openstack.model.compute.FloatingIp; -import org.openstack.model.compute.Image; -import org.openstack.model.compute.ImageList; -import org.openstack.model.compute.KeyPair; -import org.openstack.model.compute.KeyPairListItem; -import org.openstack.model.compute.SecurityGroup; -import org.openstack.model.compute.SecurityGroupForCreate; -import org.openstack.model.compute.SecurityGroupRule; -import org.openstack.model.compute.SecurityGroupRuleForCreate; -import org.openstack.model.compute.Server; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.ServerForCreate; -import org.openstack.model.compute.ServerList; -import org.openstack.model.compute.Snapshot; -import org.openstack.model.compute.SnapshotForCreate; -import org.openstack.model.compute.Volume; -import org.openstack.model.compute.nova.floatingip.NovaFloatingIpPool; -import org.openstack.model.compute.nova.keypair.NovaKeyPair; -import org.openstack.model.compute.nova.volume.VolumeForCreate; - -import com.google.common.base.Function; -import com.google.common.collect.Lists; - -public class ComputeClient { - - private TenantResource resource; - - public ComputeClient(TenantResource resource) { - this.resource = resource; - } - - public ServerList listServers() { - return resource.servers().get(); - } - - public ServerList listServers(Map filters) { - return resource.servers().get(filters); - } - - public Server createServer(ServerForCreate serverForCreate) { - return resource.servers().post(serverForCreate); - } - - public Server showServer(String id) { - return resource.servers().server(id).get(); - } - - public void deleteServer(String id) { - resource.servers().server(id).delete(); - } - - public Serializable executeServerAction(String id, ServerAction action) { - return resource.servers().server(id).action().post(action, action.getReturnType()); - - } - - public FlavorList listFlavors() { - return resource.flavors().get(); - } - - public FlavorList listFlavors(int offset, int max) { - return resource.flavors().get(); - } - - public FlavorList listFlavors(Map params) { - return resource.flavors().get(); - } - - public Flavor createFlavor(Flavor flavor) { - return resource.flavors().post(flavor); - } - - public Flavor showFlavor(String id) { - return resource.flavors().flavor(id).get(); - } - - public void deleteFlavor(String id) { - resource.flavors().flavor(id).delete(); - } - - public ImageList listImages() { - return resource.images().get(); - } - - public ImageList listImages(int offset, int max) { - return resource.images().get(); - } - - public ImageList listImages(Map params) { - return resource.images().get(); - } - - public Image showImage(String id) { - return resource.images().image(id).get(); - } - - public List listFloatingIpPools() { - resource.floatingIpPools().get(); - return new ArrayList(); - } - - public List listFloatingIps() { - return resource.floatingIps().get().getList(); - } - - public FloatingIp allocateFloatingIp(String pool) { - return resource.floatingIps().post(pool); - } - - public void deallocateFloatingIp(Integer id) { - resource.floatingIps().floatingIp(id).delete(); - } - - public List listKeyPairs() { - return new ArrayList(Lists.transform(resource.keyPairs().get().getList(), new Function() { - - @Override - public KeyPair apply(KeyPairListItem item) { - return item.getKeypair(); - } - })); - } - - public KeyPair createKeyPair(String name) { - return resource.keyPairs().post(new NovaKeyPair(name)); - } - - public void deleteKeyPair(String name) { - resource.keyPairs().keypair(name).delete(); - } - - public List listSecurityGroups() { - return resource.securityGroups().get().getList(); - } - - public SecurityGroup createSecurityGroup(SecurityGroupForCreate securityGroupForCreate) { - return resource.securityGroups().post(securityGroupForCreate); - } - - public SecurityGroup showSecurityGroup(Integer id) { - return resource.securityGroups().securityGroup(id).get(); - } - - public void deleteSecurityGroup(Integer id) { - resource.securityGroups().securityGroup(id).delete(); - } - - public SecurityGroupRule addSecurityGroupRule(SecurityGroupRuleForCreate rule) { - return resource.securityGroupRules().post(rule); - } - - public void removeSecurityGroupRule(Integer id) { - resource.securityGroupRules().rule(id).delete(); - } - - public List listVolumes() { - return resource.volumes().get().getList(); - } - - public Volume createVolume(VolumeForCreate volume) { - return resource.volumes().post(volume); - } - - public Volume showVolume(String id) { - return resource.volumes().volume(id).get(); - } - - public void deleteVolume(String id) { - resource.volumes().volume(id).delete(); - } - - public List listSnapshots() { - return resource.snapshots().get().getList(); - } - - public Snapshot createSnapshot(SnapshotForCreate snapshot) { - return resource.snapshots().post(snapshot); - } - - public Snapshot showSnapshot(String id) { - return resource.snapshots().snapshot(id).get(); - } - - public void deleteSnapshot(String id) { - resource.snapshots().snapshot(id).delete(); - } - -} diff --git a/src/main/java/org/openstack/client/IdentityClient.java b/src/main/java/org/openstack/client/IdentityClient.java deleted file mode 100644 index acb54d233..000000000 --- a/src/main/java/org/openstack/client/IdentityClient.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.openstack.client; - -import java.util.List; - -import org.openstack.api.identity.IdentityAdministrationEndpoint; -import org.openstack.model.identity.Endpoint; -import org.openstack.model.identity.Role; -import org.openstack.model.identity.Service; -import org.openstack.model.identity.Tenant; -import org.openstack.model.identity.TenantList; -import org.openstack.model.identity.User; -import org.openstack.model.identity.UserForCreate; - -public class IdentityClient { - - IdentityAdministrationEndpoint endpoint; - - public IdentityClient(IdentityAdministrationEndpoint endpoint) { - this.endpoint = endpoint; - } - - public TenantList listTenants(int start, int max) { - return endpoint.tenants().get(); - } - - public Tenant createTenant(Tenant tenant) { - return endpoint.tenants().post(tenant); - } - - public Tenant showTenant(String id) { - return endpoint.tenants().tenant(id).get(); - } - - public void deleteTenant(String id) { - endpoint.tenants().tenant(id).delete(); - } - - public List listUsers() { - return endpoint.users().get().getList(); - } - - public User createUser(UserForCreate userForCreate) { - return endpoint.users().post(userForCreate); - } - - public User updateUser(User user) { - return endpoint.users().user(user.getId()).put(user); - } - - public void deleteUser(String id) { - endpoint.users().user(id).delete(); - } - - public List listRoles() { - return endpoint.roles().get().getList(); - } - - public Role createRole(Role role) { - return endpoint.roles().post(role); - } - - public Role showRole(String id) { - return endpoint.roles().role(id).get(); - } - - public Role updateRole(Role role) { - return endpoint.roles().role(role.getId()).put(role); - } - - public void deleteRole(String id) { - endpoint.roles().role(id).delete(); - - } - - public List listServices() { - return endpoint.services().get().getList(); - } - - public Service createService(Service service) { - return endpoint.services().post(service); - } - - public void deleteService(String id) { - endpoint.services().service(id).delete(); - } - - public List listEndpoints() { - return endpoint.endpoints().get().getList(); - } - - public Endpoint createEndpoint(Endpoint endpointForCreate) { - return endpoint.endpoints().post(endpointForCreate); - } - - public void deleteEndpoint(String id) { - endpoint.endpoints().endpoint(id).delete(); - - } - -} diff --git a/src/main/java/org/openstack/client/ImagesClient.java b/src/main/java/org/openstack/client/ImagesClient.java deleted file mode 100644 index 6292aceee..000000000 --- a/src/main/java/org/openstack/client/ImagesClient.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.client; - -import java.util.Map; - -import org.openstack.api.images.ImagesResource; -import org.openstack.model.images.ImageList; - -public class ImagesClient { - - private ImagesResource resource; - - public ImagesClient(ImagesResource resource) { - this.resource = resource; - } - - public ImageList listImages() { - return resource.get(); - } - - public ImageList listImages(int offset, int max) { - return resource.get(); - } - - public ImageList listImages(Map params) { - return resource.get(); - } - - public void deleteImage(String id) { - resource.image(id).delete(); - - } - -} diff --git a/src/main/java/org/openstack/client/OpenStackClient.java b/src/main/java/org/openstack/client/OpenStackClient.java deleted file mode 100644 index 8f47cfaf4..000000000 --- a/src/main/java/org/openstack/client/OpenStackClient.java +++ /dev/null @@ -1,205 +0,0 @@ -package org.openstack.client; - -import java.io.IOException; -import java.util.Properties; - -import javax.ws.rs.client.Target; - -import org.glassfish.jersey.message.MessageProperties; -import org.openstack.api.common.Resource; -import org.openstack.api.common.RestClient; -import org.openstack.api.compute.TenantResource; -import org.openstack.api.identity.IdentityAdministrationEndpoint; -import org.openstack.api.identity.IdentityInternalEndpoint; -import org.openstack.api.identity.IdentityPublicEndpoint; -import org.openstack.api.images.ImagesResource; -import org.openstack.api.storage.AccountResource; -import org.openstack.model.exceptions.OpenStackException; -import org.openstack.model.identity.Access; -import org.openstack.model.identity.Authentication; -import org.openstack.model.identity.keystone.KeystoneAuthentication; - -import com.google.common.base.Preconditions; - -public class OpenStackClient { - - //private LoggingFilter loggingFilter = new LoggingFilter(Logger.getLogger(OpenStackClient.class.getPackage().getName()),false); - - //private LoggingFilter loggingEntityFilter = new LoggingFilter(Logger.getLogger(OpenStackClient.class.getPackage().getName()),true); - - private Properties properties; - - private Access access; - - private XAuthTokenFilter authFilter; - - private XAuthTokenFilter authAsAdministratorFilter; - - private OpenStackClient() { - System.setProperty(MessageProperties.IO_BUFFER_SIZE,"4096"); - } - - public static OpenStackClient authenticate(Properties properties, Access access) { - OpenStackClient client = new OpenStackClient(); - properties.put("auth.token", access.getToken().getId()); - client.properties = properties; - client.access = access; - client.authFilter = new XAuthTokenFilter(access.getToken().getId()); - client.authAsAdministratorFilter = new XAuthTokenFilter(properties.getProperty("identity.admin.token")); - return client; - } - - public static OpenStackClient authenticate(Properties properties) { - OpenStackClient client = new OpenStackClient(); - client.properties = properties; - - String credentials = properties.getProperty("auth.credentials"); - - KeystoneAuthentication authentication = null; - - if("apiAccessKeyCredentials".equals(credentials)) { - String accessKey = properties.getProperty("auth.accessKey"); - String secretKey = properties.getProperty("auth.secretKey"); - authentication = KeystoneAuthentication.withApiAccessKeyCredentials(accessKey, secretKey); - } else { - String username = properties.getProperty("auth.username"); - String password = properties.getProperty("auth.password"); - authentication = KeystoneAuthentication.withPasswordCredentials(username, password); - } - - String tenantId = properties.getProperty("auth.tenantId"); - String tenantName = properties.getProperty("auth.tenantName"); - - if(tenantId != null) { - authentication.setTenantId(tenantId); - } else if(tenantName != null) { - authentication.setTenantName(tenantName); - } - Access access = client.getIdentityEndpoint().tokens().post(authentication); - return authenticate(properties, access); - } - - public static OpenStackClient authenticate() { - try { - Properties properties = new Properties(); - properties.load(OpenStackClient.class.getResourceAsStream("/openstack.properties")); - return authenticate(properties); - } catch (IOException e) { - throw new OpenStackException("openstack.properties not found in the CLASSPATH"); - } - } - - public OpenStackClient reauthenticateOnTenantById(String tenantId) { - properties.setProperty("auth.tenantId", tenantId); - return authenticate(properties); - } - - public OpenStackClient reauthenticateOnTenantByName(String tenantName) { - properties.setProperty("auth.tenantName", tenantName); - return authenticate(properties); - } - - public void exchangeTokenForTenant(String tenantId) { - String endpoint = properties.getProperty("identity.endpoint.publicURL"); - Authentication authentication = KeystoneAuthentication.withTokenAndTenant(access.getToken().getId(), tenantId); - this.access = target(endpoint, IdentityPublicEndpoint.class).tokens().post(authentication); - } - - public Access getAccess() { - return this.access; - } - - public IdentityClient getIdentityClient() { - return new IdentityClient(getIdentityAdministationEndpoint()); - } - - public IdentityPublicEndpoint getIdentityEndpoint() { - String url = properties.getProperty("identity.endpoint.publicURL"); - Preconditions.checkNotNull(url, "'identity.endpoint.publicURL' property not found"); - return target(url, IdentityPublicEndpoint.class); - } - - public IdentityInternalEndpoint getIdentityInternalEndpoint() { - String url = properties.getProperty("identity.endpoint.public"); - Preconditions.checkNotNull(url, "'identity.endpoint.internalURL' property not found"); - return target(url, IdentityInternalEndpoint.class); - } - - public IdentityAdministrationEndpoint getIdentityAdministationEndpoint() { - String url = properties.getProperty("identity.endpoint.adminURL"); - Preconditions.checkNotNull(url, "'identity.endpoint.adminURL' property not found"); - return target(url, IdentityAdministrationEndpoint.class, true); - } - - public ComputeClient getComputeClient() { - return new ComputeClient(getComputeEndpoint()); - } - - public TenantResource getComputeEndpoint() { - return target(access.getEndpoint("compute", null).getPublicURL(), TenantResource.class); - } - - public ComputeClient getComputeInternalClient() { - return new ComputeClient(getComputeInternalEndpoint()); - } - - public TenantResource getComputeInternalEndpoint() { - return target(access.getEndpoint("compute", null).getInternalURL(), TenantResource.class); - } - - public ComputeClient getComputeAdministrationClient() { - return new ComputeClient(getComputeAdministationEndpoint()); - } - - public TenantResource getComputeAdministationEndpoint() { - return target(access.getEndpoint("compute", null).getAdminURL(), TenantResource.class); - } - - public ImagesClient getImagesClient() { - return new ImagesClient(getImagesEndpoint()); - } - - public ImagesResource getImagesEndpoint() { - return target(access.getEndpoint("image", null).getPublicURL().concat("/v1/images"), ImagesResource.class); - } - - public ImagesResource getImagesInternalEndpoint() { - return target(access.getEndpoint("image", null).getAdminURL().concat("/images"), ImagesResource.class); - } - - public ImagesResource getImagesAdministationEndpoint() { - return target(access.getEndpoint("image", null).getAdminURL().concat("/images"), ImagesResource.class); - } - - public AccountResource getStorageEndpoint() { - return target(access.getEndpoint("object-store", null).getPublicURL(), AccountResource.class); - } - - public AccountResource getStorageInternalEndpoint() { - return target(access.getEndpoint("object-store", null).getInternalURL().replace("AUTH_", ""), AccountResource.class); - } - - public AccountResource getStorageAdministationEndpoint() { - return target(access.getEndpoint("object-store", null).getAdminURL().replace("AUTH_", ""), AccountResource.class); - } - - public T target(String absoluteURL, Class clazz) { - return target(absoluteURL, clazz, false); - } - - private T target(String absoluteURL, Class clazz, boolean useAdministrationToken) { - try { - Target target = RestClient.INSTANCE.getJerseyClient().target(absoluteURL); - if (access != null) { - target.configuration().register(useAdministrationToken ? authAsAdministratorFilter : authFilter); - } - return clazz.getConstructor(Target.class, Properties.class).newInstance(target, properties); - } catch (Exception e) { - throw new RuntimeException(e.getMessage(), e); - } - - } - - - -} diff --git a/src/main/java/org/openstack/client/StorageClient.java b/src/main/java/org/openstack/client/StorageClient.java deleted file mode 100644 index c976b79fe..000000000 --- a/src/main/java/org/openstack/client/StorageClient.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.openstack.client; - -import java.io.File; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import java.util.Properties; - -import javax.ws.rs.client.Target; -import javax.ws.rs.core.Response; - -import org.glassfish.jersey.filter.LoggingFilter; -import org.openstack.api.authentication.AuthenticationProvider; -import org.openstack.api.common.RestClient; -import org.openstack.api.storage.AccountResource; -import org.openstack.api.storage.ContainerResource; -import org.openstack.model.exceptions.OpenStackException; -import org.openstack.model.storage.StorageContainer; -import org.openstack.model.storage.StorageObjectProperties; -import org.openstack.model.storage.swift.SwiftContainer; -import org.openstack.model.storage.swift.SwiftStorageObject; - -public class StorageClient { - - private AccountResource accountResource; - - public static final StorageClient authenticate(Properties properties) { - try { - AuthenticationProvider authenticationProvider = (AuthenticationProvider) - Class.forName(properties.getProperty("auth.provider")).newInstance(); - Properties authProperties = authenticationProvider.authenticate(properties); - Target target = RestClient.INSTANCE.getJerseyClient().target(authProperties.getProperty("storage.endpoint")); - target.configuration().register(new LoggingFilter()); - target.configuration().register(new XAuthTokenFilter(authProperties.getProperty("auth.token"))); - StorageClient client = new StorageClient(); - client.accountResource = new AccountResource(target, authProperties); - return client; - } catch (Exception e) { - throw new OpenStackException(e.getMessage(),e); - } - - } - - public List listContainers() { - return accountResource.get(); - } - - public void createContainer(String id) { - accountResource.container(id).put(); - } - - public StorageContainer showContainer(String name) { - Response response = accountResource.container(name).head(); - System.out.println(response); - return new SwiftContainer(); - } - - - public void deleteContainer(String id) { - accountResource.container(id).delete(); - } - - public List listObjects(String containerName, String prefix) { - ContainerResource container = accountResource.container(containerName); - return container.get(prefix,"/"); - } - - - - public void createDirectory(String containerName, String directoryName) { - Response response = accountResource.container(containerName).object(directoryName).put(); - } - - public void createObject(String containerId, String objectId, InputStream is, Map properties) { - Response response = accountResource.container(containerId).object(objectId).put(is, properties); - } - - public void createObject(String containerId, String objectId, File file, Map properties) { - Response response = accountResource.container(containerId).object(objectId).put(file, properties); - } - - public void createObject(String containerId, String objectId, File file) { - Response response = accountResource.container(containerId).object(objectId).put(file, null); - } - - public StorageObjectProperties showObject(String containerId, String objectId) { - return accountResource.container(containerId).object(objectId).head(); - } - - public InputStream getObjectAsInputStream(String containerId, String objectId) { - return accountResource.container(containerId).object(objectId).get(InputStream.class); - } - - public String getObjectAsString(String containerId, String objectId) { - return accountResource.container(containerId).object(objectId).get(String.class); - } - - public byte[] getObjectAsByteArray(String containerId, String objectId) { - return accountResource.container(containerId).object(objectId).get(byte[].class); - } - - public void deleteObject(String containerId, String objectId) { - Response response = accountResource.container(containerId).object(objectId).delete(); - } - - public AccountResource getAccountResource() { - return accountResource; - } - - -} diff --git a/src/main/java/org/openstack/client/XAuthTokenFilter.java b/src/main/java/org/openstack/client/XAuthTokenFilter.java deleted file mode 100644 index a6f9d077c..000000000 --- a/src/main/java/org/openstack/client/XAuthTokenFilter.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.client; - -import java.io.IOException; - -import javax.ws.rs.ext.FilterContext; -import javax.ws.rs.ext.RequestFilter; - -public class XAuthTokenFilter implements RequestFilter { - - private String token; - - public XAuthTokenFilter(String token) { - this.token = token; - } - - @Override - public void preFilter(FilterContext context) throws IOException { - context.getRequestBuilder().header("X-Auth-Token", token); - } - -} diff --git a/src/main/java/org/openstack/model/atom/Link.java b/src/main/java/org/openstack/model/atom/Link.java deleted file mode 100644 index 2bcb5ef91..000000000 --- a/src/main/java/org/openstack/model/atom/Link.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openstack.model.atom; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement(name="link") -@XmlAccessorType(XmlAccessType.NONE) -public class Link implements Serializable { - - @XmlAttribute - private String rel; - - @XmlAttribute - private String href; - - @XmlAttribute - private String type; - - public String getRel() { - return rel; - } - - public void setRel(String rel) { - this.rel = rel; - } - - public String getHref() { - return href; - } - - public void setHref(String href) { - this.href = href; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - @Override - public String toString() { - return "Link [rel=" + rel + ", href=" + href + ", type=" + type + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/atom/jaxb.index b/src/main/java/org/openstack/model/atom/jaxb.index deleted file mode 100644 index 75dba258b..000000000 --- a/src/main/java/org/openstack/model/atom/jaxb.index +++ /dev/null @@ -1 +0,0 @@ -Link \ No newline at end of file diff --git a/src/main/java/org/openstack/model/atom/package-info.java b/src/main/java/org/openstack/model/atom/package-info.java deleted file mode 100644 index c492f0819..000000000 --- a/src/main/java/org/openstack/model/atom/package-info.java +++ /dev/null @@ -1,2 +0,0 @@ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2005/Atom", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.openstack.model.atom; \ No newline at end of file diff --git a/src/main/java/org/openstack/model/common/Extension.java b/src/main/java/org/openstack/model/common/Extension.java deleted file mode 100644 index d6a9d3a74..000000000 --- a/src/main/java/org/openstack/model/common/Extension.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.openstack.model.common; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.atom.Link; - -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("extension") -public class Extension implements Serializable { - - @XmlAttribute - private String alias; - - @XmlAttribute - private String updated; - - @XmlAttribute - private String namespace; - - @XmlAttribute - private String name; - - @XmlElement - private String description; - - private List links = new ArrayList(); - - public String getAlias() { - return alias; - } - - public void setAlias(String alias) { - this.alias = alias; - } - - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - public String getNamespace() { - return namespace; - } - - public void setNamespace(String namespace) { - this.namespace = namespace; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - @Override - public String toString() { - return "Extension [alias=" + alias + ", updated=" + updated + ", namespace=" + namespace + ", name=" + name + ", description=" + description + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/common/ExtensionList.java b/src/main/java/org/openstack/model/common/ExtensionList.java deleted file mode 100644 index bfcb9aa6f..000000000 --- a/src/main/java/org/openstack/model/common/ExtensionList.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.openstack.model.common; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; - -@XmlRootElement(name = "extensions") -@XmlAccessorType(XmlAccessType.NONE) -public class ExtensionList implements Iterable { - - @XmlElement(name = "extension") - @JsonProperty("extensions") - private List list = new ArrayList(); - - public List getList() { - return list; - } - - @Override - public Iterator iterator() { - return list.iterator(); - } - - @Override - public String toString() { - return "ExtensionList [list=" + list + "]"; - } -} diff --git a/src/main/java/org/openstack/model/common/ListWithAtomLinks.java b/src/main/java/org/openstack/model/common/ListWithAtomLinks.java deleted file mode 100644 index 5eab45533..000000000 --- a/src/main/java/org/openstack/model/common/ListWithAtomLinks.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openstack.model.common; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -import org.openstack.model.atom.Link; - -@XmlType -@XmlAccessorType(XmlAccessType.NONE) -public abstract class ListWithAtomLinks implements Serializable { - - @XmlElement(name = "link", namespace = "http://www.w3.org/2005/Atom") - private List links = new ArrayList(); - - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - -} diff --git a/src/main/java/org/openstack/model/common/jaxb.index b/src/main/java/org/openstack/model/common/jaxb.index deleted file mode 100644 index 2de26c460..000000000 --- a/src/main/java/org/openstack/model/common/jaxb.index +++ /dev/null @@ -1,3 +0,0 @@ -Extension -ExtensionList -ListWithAtomLinks \ No newline at end of file diff --git a/src/main/java/org/openstack/model/common/package-info.java b/src/main/java/org/openstack/model/common/package-info.java deleted file mode 100644 index 33f33b2b0..000000000 --- a/src/main/java/org/openstack/model/common/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -@XmlSchema(namespace = "http://docs.openstack.org/common/api/v1.0", - xmlns = { - @XmlNs(namespaceURI = "http://docs.openstack.org/common/api/v1.0", prefix = "") - }, - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) - -package org.openstack.model.common; - -import javax.xml.bind.annotation.XmlNs; -import javax.xml.bind.annotation.XmlSchema; - diff --git a/src/main/java/org/openstack/model/compute/AddressList.java b/src/main/java/org/openstack/model/compute/AddressList.java deleted file mode 100644 index a386d509d..000000000 --- a/src/main/java/org/openstack/model/compute/AddressList.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -import org.openstack.model.compute.nova.NovaAddressList.Network; - -public interface AddressList { - - List getNetworks(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/Console.java b/src/main/java/org/openstack/model/compute/Console.java deleted file mode 100644 index a00849685..000000000 --- a/src/main/java/org/openstack/model/compute/Console.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.openstack.model.compute; - -public interface Console { - - String getId(); - - String getType(); - - String getPassword(); - - String getInstanceName(); - - String getRxtxFactor(); - - int getPort(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/ConsoleList.java b/src/main/java/org/openstack/model/compute/ConsoleList.java deleted file mode 100644 index a9c9b3bcf..000000000 --- a/src/main/java/org/openstack/model/compute/ConsoleList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface ConsoleList { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/Fault.java b/src/main/java/org/openstack/model/compute/Fault.java deleted file mode 100644 index 85d56a297..000000000 --- a/src/main/java/org/openstack/model/compute/Fault.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openstack.model.compute; - -public interface Fault { - - int getCode(); - - String getCreated(); - - String getMessage(); - - String getDetails(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/Flavor.java b/src/main/java/org/openstack/model/compute/Flavor.java deleted file mode 100644 index b2b54bbcf..000000000 --- a/src/main/java/org/openstack/model/compute/Flavor.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -import org.openstack.model.atom.Link; - -public interface Flavor { - - String getId(); - - String getName(); - - int getRam(); - - int getVcpus(); - - float getRxTxFactor(); - - int getDisk(); - - int getEphemeralGb(); - - void setEphemeralGb(int value); - - String getSwap(); - - List getLinks(); - - Link getLink(final String rel); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/FlavorList.java b/src/main/java/org/openstack/model/compute/FlavorList.java deleted file mode 100644 index d1e967cf5..000000000 --- a/src/main/java/org/openstack/model/compute/FlavorList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface FlavorList extends Iterable { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/FloatingIp.java b/src/main/java/org/openstack/model/compute/FloatingIp.java deleted file mode 100644 index 33febf55e..000000000 --- a/src/main/java/org/openstack/model/compute/FloatingIp.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.openstack.model.compute; - -public interface FloatingIp { - - Integer getId(); - - void setId(Integer id); - - String getIp(); - - void setIp(String ip); - - String getPool(); - - void setPool(String pool); - - String getInstanceId(); - - void setInstanceId(String instanceId); - - String getFixedIp(); - - void setFixedIp(String fixedIp); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/FloatingIpList.java b/src/main/java/org/openstack/model/compute/FloatingIpList.java deleted file mode 100644 index b7029b035..000000000 --- a/src/main/java/org/openstack/model/compute/FloatingIpList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface FloatingIpList { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/Image.java b/src/main/java/org/openstack/model/compute/Image.java deleted file mode 100644 index f3d538e31..000000000 --- a/src/main/java/org/openstack/model/compute/Image.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; -import java.util.Map; - -import org.openstack.model.atom.Link; - -public interface Image { - - String getId(); - - String getName(); - - String getStatus(); - - String getUpdated(); - - String getCreated(); - - int getMinDisk(); - - int getProgress(); - - Map getMetadata(); - - List getLinks(); - - Link getLink(final String rel); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/ImageList.java b/src/main/java/org/openstack/model/compute/ImageList.java deleted file mode 100644 index 8464f34fa..000000000 --- a/src/main/java/org/openstack/model/compute/ImageList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface ImageList extends Iterable { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/KeyPair.java b/src/main/java/org/openstack/model/compute/KeyPair.java deleted file mode 100644 index 87812d586..000000000 --- a/src/main/java/org/openstack/model/compute/KeyPair.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.openstack.model.compute; - -public interface KeyPair { - - String getName(); - - String getPublicKey(); - - String getFingerprint(); - - String getUserId(); - - String getPrivateKey(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/KeyPairList.java b/src/main/java/org/openstack/model/compute/KeyPairList.java deleted file mode 100644 index 0c3de6130..000000000 --- a/src/main/java/org/openstack/model/compute/KeyPairList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface KeyPairList { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/KeyPairListItem.java b/src/main/java/org/openstack/model/compute/KeyPairListItem.java deleted file mode 100644 index f0314e7b6..000000000 --- a/src/main/java/org/openstack/model/compute/KeyPairListItem.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openstack.model.compute; - -public interface KeyPairListItem { - - KeyPair getKeypair(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/SecurityGroup.java b/src/main/java/org/openstack/model/compute/SecurityGroup.java deleted file mode 100644 index 1a159074a..000000000 --- a/src/main/java/org/openstack/model/compute/SecurityGroup.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface SecurityGroup { - - void setRules(List rules); - - List getRules(); - - void setDescription(String description); - - String getDescription(); - - void setName(String name); - - String getName(); - - void setTenantId(String tenantId); - - String getTenantId(); - - void setId(Integer id); - - Integer getId(); - -} diff --git a/src/main/java/org/openstack/model/compute/SecurityGroupForCreate.java b/src/main/java/org/openstack/model/compute/SecurityGroupForCreate.java deleted file mode 100644 index fd181dbaa..000000000 --- a/src/main/java/org/openstack/model/compute/SecurityGroupForCreate.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openstack.model.compute; - -public interface SecurityGroupForCreate { - - String getName(); - - void setName(String name); - - String getDescription(); - - void setDescription(String description); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/SecurityGroupList.java b/src/main/java/org/openstack/model/compute/SecurityGroupList.java deleted file mode 100644 index 66f3f8a56..000000000 --- a/src/main/java/org/openstack/model/compute/SecurityGroupList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface SecurityGroupList { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/SecurityGroupRule.java b/src/main/java/org/openstack/model/compute/SecurityGroupRule.java deleted file mode 100644 index 0c62e71a0..000000000 --- a/src/main/java/org/openstack/model/compute/SecurityGroupRule.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.openstack.model.compute; - -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroupRule.Group; -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroupRule.IpRange; - -public interface SecurityGroupRule { - - public abstract void setGroup(Group group); - - public abstract Group getGroup(); - - public abstract void setIpRange(IpRange ipRange); - - public abstract IpRange getIpRange(); - - public abstract void setIpProtocol(String ipProtocol); - - public abstract String getIpProtocol(); - - public abstract void setToPort(Integer toPort); - - public abstract Integer getToPort(); - - public abstract void setFromPort(Integer fromPort); - - public abstract Integer getFromPort(); - - public abstract void setParentGroupId(Integer parentGroupId); - - public abstract Integer getParentGroupId(); - - public abstract void setName(String name); - - public abstract String getName(); - - public abstract void setId(Integer id); - - public abstract Integer getId(); - -} diff --git a/src/main/java/org/openstack/model/compute/SecurityGroupRuleForCreate.java b/src/main/java/org/openstack/model/compute/SecurityGroupRuleForCreate.java deleted file mode 100644 index bd11a0fad..000000000 --- a/src/main/java/org/openstack/model/compute/SecurityGroupRuleForCreate.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openstack.model.compute; - -public interface SecurityGroupRuleForCreate { - - Integer getParentGroupId(); - - void setParentGroupId(Integer parentGroupId); - - Integer getFromPort(); - - void setFromPort(Integer fromPort); - - Integer getToPort(); - - void setToPort(Integer toPort); - - String getIpProtocol(); - - void setIpProtocol(String ipProtocol); - - String getCidr(); - - void setCidr(String cidr); - - Integer getGroupId(); - - void setGroupId(Integer groupId); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/Server.java b/src/main/java/org/openstack/model/compute/Server.java deleted file mode 100644 index ce674be9e..000000000 --- a/src/main/java/org/openstack/model/compute/Server.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openstack.model.compute; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -import org.openstack.model.atom.Link; -import org.openstack.model.compute.nova.NovaAddressList.Network; - -public interface Server { - - String getId(); - - String getName(); - - String getStatus(); - - Date getUpdated(); - - Date getCreated(); - - String getHostId(); - - String getUserId(); - - String getTenantId(); - - String getAccessIPv4(); - - String getAccessIPv6(); - - String getAdminPass(); - - String getProgress(); - - String getConfigDrive(); - - String getKeyName(); - - Image getImage(); - - Flavor getFlavor(); - - Fault getFault(); - - Map getMetadata(); - - Map> getAddresses(); - - List getLinks(); - - Link getLink(final String rel); - - public Map getExtensions(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/ServerAction.java b/src/main/java/org/openstack/model/compute/ServerAction.java deleted file mode 100644 index 80465766d..000000000 --- a/src/main/java/org/openstack/model/compute/ServerAction.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.io.Serializable; - -public interface ServerAction extends Serializable { - - Class getReturnType(); - -} diff --git a/src/main/java/org/openstack/model/compute/ServerForCreate.java b/src/main/java/org/openstack/model/compute/ServerForCreate.java deleted file mode 100644 index c70647e06..000000000 --- a/src/main/java/org/openstack/model/compute/ServerForCreate.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; -import java.util.Map; - -import org.openstack.model.compute.nova.NovaServerForCreate.File; -import org.openstack.model.compute.nova.NovaServerForCreate.SecurityGroup; - -public interface ServerForCreate { - - String getName(); - - void setName(String name); - - Integer getMin(); - - void setMin(Integer min); - - Integer getMax(); - - void setMax(Integer max); - - String getImageRef(); - - void setImageRef(String imageRef); - - String getFlavorRef(); - - void setFlavorRef(String flavorRef); - - String getZone(); - - void setZone(String zone); - - String getKeyName(); - - void setKeyName(String keyName); - - String getAccessIPv4(); - - void setAccessIPv4(String accessIPv4); - - String getAccessIPv6(); - - void setAccessIPv6(String accessIPv6); - - Map getMetadata(); - - void setMetadata(Map metadata); - - List getPersonality(); - - void setPersonality(List personality); - - List getSecurityGroups(); - - void setSecurityGroups(List securityGroups); - - void addUploadFile(String path, String contents); - - boolean getConfigDrive(); - - void setConfigDrive(boolean configDrive); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/ServerList.java b/src/main/java/org/openstack/model/compute/ServerList.java deleted file mode 100644 index 891a593f2..000000000 --- a/src/main/java/org/openstack/model/compute/ServerList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface ServerList extends Iterable { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/Snapshot.java b/src/main/java/org/openstack/model/compute/Snapshot.java deleted file mode 100644 index bd6bf46f2..000000000 --- a/src/main/java/org/openstack/model/compute/Snapshot.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openstack.model.compute; - -public interface Snapshot { - - String getId(); - - String getStatus(); - - Integer getSizeInGB(); - - String getCreated(); - - String getName(); - - String getDescription(); - - String getVolumeId(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/SnapshotForCreate.java b/src/main/java/org/openstack/model/compute/SnapshotForCreate.java deleted file mode 100644 index 6ff325b71..000000000 --- a/src/main/java/org/openstack/model/compute/SnapshotForCreate.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.model.compute; - -public interface SnapshotForCreate { - - String getVolumeId(); - - void setVolumeId(String volumeId); - - Boolean getForce(); - - void setForce(Boolean force); - - String getName(); - - void setName(String name); - - String getDescription(); - - void setDescription(String description); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/SnapshotList.java b/src/main/java/org/openstack/model/compute/SnapshotList.java deleted file mode 100644 index ce1ad3d26..000000000 --- a/src/main/java/org/openstack/model/compute/SnapshotList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface SnapshotList { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/Volume.java b/src/main/java/org/openstack/model/compute/Volume.java deleted file mode 100644 index a01e96746..000000000 --- a/src/main/java/org/openstack/model/compute/Volume.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; -import java.util.Map; - -import org.openstack.model.compute.nova.volume.NovaVolumeAttachment; - -public interface Volume { - - String getId(); - - String getStatus(); - - Integer getSizeInGB(); - - String getAvailabilityZone(); - - String getType(); - - String getCreated(); - - String getName(); - - String getDescription(); - - Integer getSnapshotId(); - - Map getMetadata(); - - List getAttachments(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/VolumeList.java b/src/main/java/org/openstack/model/compute/VolumeList.java deleted file mode 100644 index 763c0e9be..000000000 --- a/src/main/java/org/openstack/model/compute/VolumeList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.compute; - -import java.util.List; - -public interface VolumeList { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/nova/NovaAddressList.java b/src/main/java/org/openstack/model/compute/nova/NovaAddressList.java deleted file mode 100644 index cf117db19..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaAddressList.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -import org.openstack.model.compute.AddressList; - -import com.google.common.collect.Lists; - -@XmlAccessorType(XmlAccessType.NONE) -public class NovaAddressList implements Serializable, AddressList { - - @XmlAccessorType(XmlAccessType.NONE) - public static class Network implements Serializable { - - @XmlAccessorType(XmlAccessType.NONE) - public static class Ip implements Serializable { - - @XmlAttribute - private String version; - - @XmlAttribute - private String addr; - - public Ip() { - - } - - public Ip(String version, String addr) { - this.version = version; - this.addr = addr; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getAddr() { - return addr; - } - - public void setAddr(String addr) { - this.addr = addr; - } - - @Override - public String toString() { - return "Ip [version=" + version + ", addr=" + addr + "]"; - } - - } - - @XmlAttribute - private String id; - - @XmlElement(name = "ip") - private List ips; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public List getIps() { - if (ips == null) { - ips = Lists.newArrayList(); - } - return ips; - } - - public void setIps(List ips) { - this.ips = ips; - } - - @Override - public String toString() { - return "Network [id=" + id + ", ips=" + ips + "]"; - } - - } - - - @XmlElement(name = "network") - private List networks; - - @Override - public String toString() { - return "Addresses [networks=" + networks + "]"; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.AddressList#getNetworks() - */ - @Override - public List getNetworks() { - if (networks == null) { - networks = Lists.newArrayList(); - } - return networks; - } -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaBadRequest.java b/src/main/java/org/openstack/model/compute/nova/NovaBadRequest.java deleted file mode 100644 index cdba8bbfa..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaBadRequest.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.openstack.model.compute.nova; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) -public class NovaBadRequest extends NovaErrorResponse { - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaConsole.java b/src/main/java/org/openstack/model/compute/nova/NovaConsole.java deleted file mode 100644 index 41078204f..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaConsole.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.openstack.model.compute.Console; - -@XmlRootElement(namespace="") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaConsole implements Serializable, Console { - - @XmlAttribute - private String id; - - @XmlAttribute(name="console_type") - private String type; - - @XmlAttribute - private String password; - - @XmlAttribute(name="instance_name") - private String instanceName; - - @XmlAttribute(name="host") - private String rxtxFactor; - - @XmlAttribute - private int port; - - /* (non-Javadoc) - * @see org.openstack.model.compute.Console#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Console#getType() - */ - @Override - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Console#getPassword() - */ - @Override - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Console#getInstanceName() - */ - @Override - public String getInstanceName() { - return instanceName; - } - - public void setInstanceName(String instanceName) { - this.instanceName = instanceName; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Console#getRxtxFactor() - */ - @Override - public String getRxtxFactor() { - return rxtxFactor; - } - - public void setRxtxFactor(String rxtxFactor) { - this.rxtxFactor = rxtxFactor; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Console#getPort() - */ - @Override - public int getPort() { - return port; - } - - public void setPort(int port) { - this.port = port; - } - - @Override - public String toString() { - return "Console [id=" + id + ", type=" + type + ", password=" - + password + ", instanceName=" + instanceName + ", rxtxFactor=" - + rxtxFactor + ", port=" + port + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaConsoleList.java b/src/main/java/org/openstack/model/compute/nova/NovaConsoleList.java deleted file mode 100644 index 6386dbc93..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaConsoleList.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.openstack.model.common.ListWithAtomLinks; -import org.openstack.model.compute.Console; -import org.openstack.model.compute.ConsoleList; - -@XmlRootElement(name="consoles", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaConsoleList extends ListWithAtomLinks implements ConsoleList { - - @XmlElement(name="console", namespace="") - private List list = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.compute.ConsoleList#getList() - */ - @Override - public List getList() { - return (List) (List) list; - } - - public void setList(List list) { - this.list = list; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaErrorResponse.java b/src/main/java/org/openstack/model/compute/nova/NovaErrorResponse.java deleted file mode 100644 index aa6966533..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaErrorResponse.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openstack.model.compute.nova; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -@XmlAccessorType(XmlAccessType.NONE) -abstract class NovaErrorResponse { - @XmlAttribute - String code; - - @XmlElement - String message; - - public String getCode() { - return code; - } - - public void setCode(String code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaFault.java b/src/main/java/org/openstack/model/compute/nova/NovaFault.java deleted file mode 100644 index 974051546..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaFault.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - -import org.openstack.model.compute.Fault; - -@XmlType -@XmlAccessorType(XmlAccessType.NONE) -public class NovaFault implements Serializable, Fault { - - @XmlAttribute - private int code; - - @XmlAttribute - private String created; - - @XmlElement - private String message; - - @XmlElement - private String details; - - public NovaFault() { - - } - - public NovaFault(int code, String created, String message, String details) { - this.code = code; - this.created = created; - this.message = message; - this.details = details; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Fault#getCode() - */ - @Override - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Fault#getCreated() - */ - @Override - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Fault#getMessage() - */ - @Override - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Fault#getDetails() - */ - @Override - public String getDetails() { - return details; - } - - public void setDetails(String details) { - this.details = details; - } - - @Override - public String toString() { - return "Fault [code=" + code + ", created=" + created + ", message=" - + message + ", details=" + details + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaFlavor.java b/src/main/java/org/openstack/model/compute/nova/NovaFlavor.java deleted file mode 100644 index f79c7f87b..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaFlavor.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonAnyGetter; -import org.codehaus.jackson.annotate.JsonAnySetter; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.atom.Link; -import org.openstack.model.compute.Flavor; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -@XmlRootElement(name="flavor") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("flavor") -public class NovaFlavor implements Serializable, Flavor { - - @XmlAttribute - private String id; - - @XmlAttribute - private String name; - - @XmlAttribute - private int ram; - - @XmlAttribute - private int vcpus; - - @XmlAttribute - private String swap; - - @XmlAttribute(name = "rxtx_factor") - @JsonProperty("rxtx_factor") - private float rxTxFactor; - - @XmlAttribute - private int disk; - - @JsonProperty("OS-FLV-EXT-DATA:ephemeral") - private int ephemeralGb; - - private Map extensions = new HashMap(); - - @XmlElement(name = "link", namespace = "http://www.w3.org/2005/Atom") - private List links; - - public NovaFlavor() { - - } - - public NovaFlavor(String id, String name) { - this.id = id; - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getRam() - */ - @Override - public int getRam() { - return ram; - } - - public void setRam(int ram) { - this.ram = ram; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getVcpus() - */ - @Override - public int getVcpus() { - return vcpus; - } - - public void setVcpus(int vcpus) { - this.vcpus = vcpus; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getRxTxFactor() - */ - @Override - public float getRxTxFactor() { - return rxTxFactor; - } - - public void setRxTxFactor(float rxTxFactor) { - this.rxTxFactor = rxTxFactor; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getDisk() - */ - @Override - public int getDisk() { - return disk; - } - - public void setDisk(int disk) { - this.disk = disk; - } - - public int getEphemeralGb() { - return ephemeralGb; - } - - public void setEphemeralGb(int ephemeralGb) { - this.ephemeralGb = ephemeralGb; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getSwap() - */ - @Override - public String getSwap() { - return swap; - } - - public void setSwap(String swap) { - this.swap = swap; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getLinks() - */ - @Override - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - @JsonAnyGetter - public Map getExtensions() { - return extensions; - } - - @JsonAnySetter - public void put(String key, String value) { - extensions.put(key, value); - } - - @Override - public String toString() { - return "NovaFlavor [id=" + id + ", name=" + name + ", ram=" + ram - + ", vcpus=" + vcpus + ", swap=" + swap + ", rxTxFactor=" - + rxTxFactor + ", disk=" + disk + ", links=" + links + "]"; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Flavor#getLink(java.lang.String) - */ - @Override - public Link getLink(final String rel) { - return Iterables.find(links, new Predicate() { - - @Override - public boolean apply(Link link) { - return rel.equals(link.getRel()); - } - }); - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaFlavorList.java b/src/main/java/org/openstack/model/compute/nova/NovaFlavorList.java deleted file mode 100644 index 7ae384505..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaFlavorList.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.openstack.model.compute.Flavor; -import org.openstack.model.compute.FlavorList; - -@XmlRootElement(name = "flavors") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaFlavorList implements Serializable, FlavorList { - - @XmlElement(name = "flavor") - @JsonProperty("flavors") - private List list = new ArrayList(); - - public NovaFlavorList() { - this.list = new ArrayList(); - } - - public NovaFlavorList(Collection collection) { - this.list = new ArrayList(); - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.FlavorList#getList() - */ - @Override - public List getList() { - return (List) (List) list; - } - - public void setList(List list) { - this.list = list; - - } - - @Override - public String toString() { - return "NovaFlavorList [list=" + list + "]"; - } - - @Override - public Iterator iterator() { - return getList().iterator(); - } -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaImage.java b/src/main/java/org/openstack/model/compute/nova/NovaImage.java deleted file mode 100644 index 9e9b34a04..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaImage.java +++ /dev/null @@ -1,215 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.atom.Link; -import org.openstack.model.compute.Image; -import org.openstack.model.compute.Server; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -@XmlRootElement(name="image") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("image") -public class NovaImage implements Serializable, Image { - - @XmlAttribute - private String id; - - @XmlAttribute - private String name; - - @XmlAttribute - private String status; - - //2011-12-26T02:09:15Z - @XmlAttribute - private String updated; - - @XmlAttribute - private String created; - - @XmlAttribute - private int minDisk; - - @XmlAttribute - private int minRam; - - @XmlAttribute - private int progress; - - @XmlElement(name = "server") - @JsonDeserialize(as=NovaServer.class) - private Server server; - - @XmlElement - private Map metadata; - - //RAX-DCF="http://docs.rackspacecloud.com/servers/api/ext/diskConfig/v1.0" - - @XmlElement(name="link", namespace="http://www.w3.org/2005/Atom") - private List links; - - public NovaImage() { - - } - - public NovaImage(String id, String name) { - this.id = id; - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getStatus() - */ - @Override - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getUpdated() - */ - @Override - public String getUpdated() { - return updated; - } - - public void setUpdated(String updated) { - this.updated = updated; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getCreated() - */ - @Override - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getMinDisk() - */ - @Override - public int getMinDisk() { - return minDisk; - } - - public void setMinDisk(int minDisk) { - this.minDisk = minDisk; - } - - public int getMinRam() { - return minRam; - } - - public void setMinRam(int minRam) { - this.minRam = minRam; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getProgress() - */ - @Override - public int getProgress() { - return progress; - } - - public void setProgress(int progress) { - this.progress = progress; - } - - public Server getServer() { - return server; - } - - public void setServer(Server server) { - this.server = server; - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getLinks() - */ - @Override - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - @Override - public String toString() { - return "Image [id=" + id + ", name=" + name + ", status=" + status - + ", updated=" + updated + ", created=" + created - + ", minDisk=" + minDisk + ", progress=" + progress - + ", metadata=" + metadata + ", links=" + links + "]"; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Image#getLink(java.lang.String) - */ - @Override - public Link getLink(final String rel) { - return Iterables.find(links, new Predicate() { - - @Override - public boolean apply(Link link) { - return rel.equals(link.getRel()); - } - }); - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaImageList.java b/src/main/java/org/openstack/model/compute/nova/NovaImageList.java deleted file mode 100644 index fef3eb3a5..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaImageList.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.openstack.model.compute.Image; -import org.openstack.model.compute.ImageList; - -@XmlRootElement(name = "images") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaImageList implements Serializable, ImageList { - - @XmlElement(name = "image") - @JsonProperty("images") - private List list = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.compute.ImageList#getList() - */ - @Override - public List getList() { - return (List) (List) list; - } - - public void setList(List list) { - this.list = list; - - } - - @Override - public String toString() { - return "NovaImageList [list=" + list + "]"; - } - - @Override - public Iterator iterator() { - return getList().iterator(); - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaItemNotFound.java b/src/main/java/org/openstack/model/compute/nova/NovaItemNotFound.java deleted file mode 100644 index 523b4466e..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaItemNotFound.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.openstack.model.compute.nova; - -import javax.xml.bind.annotation.XmlRootElement; - -@XmlRootElement -public class NovaItemNotFound extends NovaErrorResponse { -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaServer.java b/src/main/java/org/openstack/model/compute/nova/NovaServer.java deleted file mode 100644 index 890ea4524..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaServer.java +++ /dev/null @@ -1,396 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonAnyGetter; -import org.codehaus.jackson.annotate.JsonAnySetter; -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.atom.Link; -import org.openstack.model.compute.Fault; -import org.openstack.model.compute.Flavor; -import org.openstack.model.compute.Image; -import org.openstack.model.compute.SecurityGroup; -import org.openstack.model.compute.Server; -import org.openstack.model.compute.nova.NovaAddressList.Network; -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroup; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -@XmlRootElement(name = "server") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("server") -public class NovaServer implements Serializable, Server { - - @XmlAttribute - private String id; - - @XmlAttribute - private String name; - - @XmlAttribute - private String status; - - @XmlAttribute - private Date updated; - - @XmlAttribute - private Date created; - - @XmlAttribute - private String hostId; - - @XmlAttribute - @JsonProperty("user_id") - private String userId; - - @XmlAttribute - @JsonProperty("tenant_id") - private String tenantId; - - @XmlAttribute - private String accessIPv4; - - @XmlAttribute - private String accessIPv6; - - @XmlAttribute - private String adminPass; - - @XmlAttribute - private String progress; - - @XmlAttribute(name = "config_drive") - @JsonProperty("config_drive") - private String configDrive; - - @XmlAttribute(name = "key_name") - @JsonProperty("key_name") - private String keyName; - - @XmlElement(name = "image") - @JsonDeserialize(as=NovaImage.class) - private Image image; - - @XmlElement(name = "flavor") - @JsonDeserialize(as=NovaFlavor.class) - private Flavor flavor; - - @XmlElement(name = "fault") - @JsonDeserialize(as=NovaFault.class) - private Fault fault; - - @XmlElement(name = "metadata") - private Map metadata; - - @XmlElement(name = "addresses") - private Map> addresses; - - @JsonProperty("security_groups") - @JsonDeserialize(contentAs=NovaSecurityGroup.class) - private List securityGroups; - - @XmlElement(name = "link", namespace = "http://www.w3.org/2005/Atom") - private List links; - - private Map extensions = new HashMap(); - - @JsonAnyGetter - public Map getExtensions() { - return extensions; - } - - @JsonAnySetter - public void put(String key, String value) { - extensions.put(key, value); - } - - public NovaServer() { - // TODO Auto-generated constructor stub - } - - public NovaServer(String id, String name) { - this.id = id; - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getStatus() - */ - @Override - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getUpdated() - */ - @Override - public Date getUpdated() { - return updated; - } - - public void setUpdated(Date updated) { - this.updated = updated; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getCreated() - */ - @Override - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getHostId() - */ - @Override - public String getHostId() { - return hostId; - } - - public void setHostId(String hostId) { - this.hostId = hostId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getUserId() - */ - @Override - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getTenantId() - */ - @Override - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getAccessIpV4() - */ - @Override - public String getAccessIPv4() { - return accessIPv4; - } - - public void setAccessIPv4(String accessIPv4) { - this.accessIPv4 = accessIPv4; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getAccessIpV6() - */ - @Override - public String getAccessIPv6() { - return accessIPv6; - } - - public void setAccessIPv6(String accessIPv6) { - this.accessIPv6 = accessIPv6; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getAdminPass() - */ - @Override - public String getAdminPass() { - return adminPass; - } - - public void setAdminPass(String adminPass) { - this.adminPass = adminPass; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getProgress() - */ - @Override - public String getProgress() { - return progress; - } - - public void setProgress(String progress) { - this.progress = progress; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getConfigDrive() - */ - @Override - public String getConfigDrive() { - return configDrive; - } - - public void setConfigDrive(String configDrive) { - this.configDrive = configDrive; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getKeyName() - */ - @Override - public String getKeyName() { - return keyName; - } - - public void setKeyName(String keyName) { - this.keyName = keyName; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getImage() - */ - @Override - public Image getImage() { - return image; - } - - public void setImage(NovaImage image) { - this.image = image; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getFlavor() - */ - @Override - public Flavor getFlavor() { - return flavor; - } - - public void setFlavor(NovaFlavor flavor) { - this.flavor = flavor; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getFault() - */ - @Override - public Fault getFault() { - return fault; - } - - public void setFault(NovaFault fault) { - this.fault = fault; - } - - public List getSecurityGroups() { - return securityGroups; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getMetadata() - */ - @Override - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getAddresses() - */ - @Override - public Map> getAddresses() { - return addresses; - } - - public void setAddresses(Map> addresses) { - this.addresses = addresses; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getLinks() - */ - @Override - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - @Override - public String toString() { - return "Server [id=" + id + ", name=" + name + ", status=" + status + ", updated=" + updated + ", created=" - + created + ", hostId=" + hostId + ", userId=" + userId + ", tenantId=" + tenantId + ", accessIpV4=" - + accessIPv4 + ", accessIpV6=" + accessIPv6 + ", adminPass=" + adminPass + ", progress=" + progress - + ", configDrive=" + configDrive + ", keyName=" + keyName + ", image=" + image + ", flavor=" + flavor - + ", fault=" + fault + ", metadata=" + metadata + ", addresses=" + addresses + ", links=" + links + "]"; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Server#getLink(java.lang.String) - */ - @Override - public Link getLink(final String rel) { - return Iterables.find(links, new Predicate() { - - @Override - public boolean apply(Link link) { - return rel.equals(link.getRel()); - } - }); - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaServerForCreate.java b/src/main/java/org/openstack/model/compute/nova/NovaServerForCreate.java deleted file mode 100644 index cd318c37c..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaServerForCreate.java +++ /dev/null @@ -1,381 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerForCreate; - -import com.google.common.collect.Lists; - -@XmlRootElement(name = "server") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("server") -public class NovaServerForCreate implements Serializable, ServerForCreate { - - @XmlType - @XmlAccessorType(XmlAccessType.NONE) - public static final class SecurityGroup implements Serializable { - - @XmlElement(name = "name") - private String name; - - public SecurityGroup() { - - } - - public SecurityGroup(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public String toString() { - return "CreateSecurityGroupRequest [name=" + name + "]"; - } - - } - - @XmlType - @XmlAccessorType(XmlAccessType.NONE) - public static final class File implements Serializable { - - @XmlAttribute - private String path; - - @XmlValue - private String contents; - - public String getPath() { - return path; - } - - public void setPath(String path) { - this.path = path; - } - - public String getContents() { - return contents; - } - - public void setContents(String contents) { - this.contents = contents; - } - - } - - @XmlAttribute - private String name; - - @XmlAttribute - private Integer min; - - @XmlAttribute - private Integer max; - - @XmlAttribute - private String imageRef; - - @XmlAttribute - private String flavorRef; - - @XmlAttribute - private String accessIPv4; - - @XmlAttribute - private String accessIPv6; - - @XmlAttribute - private String zone; - - @XmlAttribute(name="key_name") - @JsonProperty("key_name") - private String keyName; - - // We have a problem here - config_drive can be both a boolean and an image ref... - // But booleans can't be quoted! - @XmlAttribute(name="config_drive") - @JsonProperty("config_drive") - private boolean configDrive; - - @XmlElementWrapper(name="metatadata") - @XmlElement(name="meta") - //private List metadata; - private Map metadata = new HashMap(); - - @XmlElementWrapper(name = "personality") - @XmlElement(name="file") - private List personality = new ArrayList(); - - /** - * This security groups are not created on the fly. They must be exist in - * the tenant. - */ - @XmlElementWrapper(name = "security_groups") - @XmlElement(name = "security_group") - private List securityGroups = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getName() - */ - @Override - public String getName() { - return name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setName(java.lang.String) - */ - @Override - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getMin() - */ - @Override - public Integer getMin() { - return min; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setMin(java.lang.Integer) - */ - @Override - public void setMin(Integer min) { - this.min = min; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getMax() - */ - @Override - public Integer getMax() { - return max; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setMax(java.lang.Integer) - */ - @Override - public void setMax(Integer max) { - this.max = max; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getImageRef() - */ - @Override - public String getImageRef() { - return imageRef; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setImageRef(java.lang.String) - */ - @Override - public void setImageRef(String imageRef) { - this.imageRef = imageRef; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getFlavorRef() - */ - @Override - public String getFlavorRef() { - return flavorRef; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setFlavorRef(java.lang.String) - */ - @Override - public void setFlavorRef(String flavorRef) { - this.flavorRef = flavorRef; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getZone() - */ - @Override - public String getZone() { - return zone; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setZone(java.lang.String) - */ - @Override - public void setZone(String zone) { - this.zone = zone; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getKeyName() - */ - @Override - public String getKeyName() { - return keyName; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setKeyName(java.lang.String) - */ - @Override - public void setKeyName(String keyName) { - this.keyName = keyName; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getAccessIPv4() - */ - @Override - public String getAccessIPv4() { - return accessIPv4; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setAccessIPv4(java.lang.String) - */ - @Override - public void setAccessIPv4(String accessIPv4) { - this.accessIPv4 = accessIPv4; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getAccessIPv6() - */ - @Override - public String getAccessIPv6() { - return accessIPv6; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setAccessIpV6(java.lang.String) - */ - @Override - public void setAccessIPv6(String accessIPv6) { - this.accessIPv6 = accessIPv6; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getMetadata() - */ - @Override - public Map getMetadata() { - return metadata; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setMetadata(java.util.List) - */ - @Override - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getPersonality() - */ - @Override - public List getPersonality() { - if (personality == null) { - personality = Lists.newArrayList(); - } - return personality; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setPersonality(java.util.List) - */ - @Override - public void setPersonality(List personality) { - this.personality = personality; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getSecurityGroups() - */ - @Override - public List getSecurityGroups() { - if (securityGroups == null) { - securityGroups = Lists.newArrayList(); - } - return securityGroups; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setSecurityGroups(java.util.List) - */ - @Override - public void setSecurityGroups(List securityGroups) { - this.securityGroups = securityGroups; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#addUploadFile(java.lang.String, java.lang.String) - */ - @Override - public void addUploadFile(String path, String contents) { - File item = new File(); - item.path = path; - item.contents = contents; - getPersonality().add(item); - } - - //public void addUploadFile(String path, String contents) { - // addUploadFile(path, contents.getBytes(Charsets.UTF_8)); - //} - - - - - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#getConfigDrive() - */ - @Override - public boolean getConfigDrive() { - return configDrive; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.ServerForCreate#setConfigDrive(boolean) - */ - @Override - public void setConfigDrive(boolean configDrive) { - this.configDrive = configDrive; - } - - @Override - public String toString() { - return "NovaServerForCreate [name=" + name + ", min=" + min + ", max=" - + max + ", imageRef=" + imageRef + ", flavorRef=" + flavorRef - + ", accessIpV4=" + accessIPv4 + ", accessIpV6=" + accessIPv6 - + ", zone=" + zone + ", keyName=" + keyName + ", configDrive=" - + configDrive + ", metadata=" + metadata + ", personality=" - + personality + ", securityGroups=" + securityGroups + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/NovaServerList.java b/src/main/java/org/openstack/model/compute/nova/NovaServerList.java deleted file mode 100644 index 34282eba4..000000000 --- a/src/main/java/org/openstack/model/compute/nova/NovaServerList.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openstack.model.compute.nova; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.openstack.model.compute.Server; -import org.openstack.model.compute.ServerList; - -@XmlRootElement(name = "servers") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaServerList implements Serializable, ServerList { - - @XmlElement(name = "server") - @JsonProperty("servers") - private List list; - - public NovaServerList() { - list = new ArrayList(); - } - - public NovaServerList(Collection values) { - list = new ArrayList(values); - } - - @Override - public String toString() { - return "ServerList [list=" + list + "]"; - } - - public void setList(List list) { - this.list = list; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.ServerList#getList() - */ - @Override - public List getList() { - return (List) (List) list; - } - - @Override - public Iterator iterator() { - return getList().iterator(); - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/aggregate/AddHostAction.java b/src/main/java/org/openstack/model/compute/nova/aggregate/AddHostAction.java deleted file mode 100644 index f214ba0df..000000000 --- a/src/main/java/org/openstack/model/compute/nova/aggregate/AddHostAction.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.openstack.model.compute.nova.aggregate; - -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("add_host") -public class AddHostAction implements AggregateAction { - - private String host; - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/aggregate/Aggregate.java b/src/main/java/org/openstack/model/compute/nova/aggregate/Aggregate.java deleted file mode 100644 index 1d6efaea5..000000000 --- a/src/main/java/org/openstack/model/compute/nova/aggregate/Aggregate.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openstack.model.compute.nova.aggregate; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("aggregate") -public class Aggregate implements Serializable { - - @JsonProperty("id") - private String id; - - @JsonProperty("name") - private String name; - - @JsonProperty("availability_zone") - private String availabiliyZone; - - private boolean deleted; - - @JsonProperty("created_at") - private String createdAt; - - @JsonProperty("updated_at") - private String updatedAt; - - @JsonProperty("operational_state") - private String operationalState; - - @JsonProperty("deleted_at") - private String deletedAt; - - @JsonProperty("hosts") - private List hosts = new ArrayList(); - - @JsonProperty("metadata") - private Map metadata = new HashMap(); - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAvailabiliyZone() { - return availabiliyZone; - } - - public void setAvailabiliyZone(String availabiliyZone) { - this.availabiliyZone = availabiliyZone; - } - - public boolean isDeleted() { - return deleted; - } - - public void setDeleted(boolean deleted) { - this.deleted = deleted; - } - - public String getCreatedAt() { - return createdAt; - } - - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - public String getUpdatedAt() { - return updatedAt; - } - - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - public String getOperationalState() { - return operationalState; - } - - public void setOperationalState(String operationalState) { - this.operationalState = operationalState; - } - - public String getDeletedAt() { - return deletedAt; - } - - public void setDeletedAt(String deletedAt) { - this.deletedAt = deletedAt; - } - - public List getHosts() { - return hosts; - } - - public void setHosts(List hosts) { - this.hosts = hosts; - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - -} diff --git a/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateAction.java b/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateAction.java deleted file mode 100644 index dd7a2effe..000000000 --- a/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateAction.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.openstack.model.compute.nova.aggregate; - -public interface AggregateAction { - -} diff --git a/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateActions.java b/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateActions.java deleted file mode 100644 index 19c261d8c..000000000 --- a/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateActions.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.openstack.model.compute.nova.aggregate; - -import java.util.Map; - -public class AggregateActions { - - public static final AddHostAction addHost(String name) { - AddHostAction action = new AddHostAction(); - action.setHost(name); - return action; - } - - public static final RemoveHostAction removeHost(String name) { - RemoveHostAction action = new RemoveHostAction(); - action.setHost(name); - return action; - - } - - public static final SetMetadataAction setMetadata(Map metadata) { - SetMetadataAction action = new SetMetadataAction(); - action.setMetadata(metadata); - return action; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateForCreate.java b/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateForCreate.java deleted file mode 100644 index e7d8d905c..000000000 --- a/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateForCreate.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openstack.model.compute.nova.aggregate; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("aggregate") -public class AggregateForCreate { - - private String name; - - @JsonProperty("availability_zone") - private String availabilityZone; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAvailabilityZone() { - return availabilityZone; - } - - public void setAvailabilityZone(String availabilityZone) { - this.availabilityZone = availabilityZone; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateList.java b/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateList.java deleted file mode 100644 index b823eae0c..000000000 --- a/src/main/java/org/openstack/model/compute/nova/aggregate/AggregateList.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.openstack.model.compute.nova.aggregate; - -import java.util.ArrayList; -import java.util.List; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class AggregateList { - - @JsonProperty("aggregates") - private List list = new ArrayList(); - - public List getList() { - return list; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/aggregate/RemoveHostAction.java b/src/main/java/org/openstack/model/compute/nova/aggregate/RemoveHostAction.java deleted file mode 100644 index a27b5d91a..000000000 --- a/src/main/java/org/openstack/model/compute/nova/aggregate/RemoveHostAction.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.openstack.model.compute.nova.aggregate; - -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("remove_host") -public class RemoveHostAction implements AggregateAction { - - private String host; - - public String getHost() { - return host; - } - - public void setHost(String host) { - this.host = host; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/aggregate/SetMetadataAction.java b/src/main/java/org/openstack/model/compute/nova/aggregate/SetMetadataAction.java deleted file mode 100644 index b2f3819ae..000000000 --- a/src/main/java/org/openstack/model/compute/nova/aggregate/SetMetadataAction.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.openstack.model.compute.nova.aggregate; - -import java.util.HashMap; -import java.util.Map; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("set_metadata") -public class SetMetadataAction implements AggregateAction { - - @JsonProperty - Map metadata = new HashMap(); - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - -} diff --git a/src/main/java/org/openstack/model/compute/nova/cloudpipe/CreateNovaCloudPipeResponse.java b/src/main/java/org/openstack/model/compute/nova/cloudpipe/CreateNovaCloudPipeResponse.java deleted file mode 100644 index d06518bae..000000000 --- a/src/main/java/org/openstack/model/compute/nova/cloudpipe/CreateNovaCloudPipeResponse.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.model.compute.nova.cloudpipe; - -import java.io.Serializable; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class CreateNovaCloudPipeResponse implements Serializable { - - - @JsonProperty("instance_id") - private String instanceId; - - public String getInstanceId() { - return instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipe.java b/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipe.java deleted file mode 100644 index 3d5ee0a42..000000000 --- a/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipe.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openstack.model.compute.nova.cloudpipe; - -import java.io.Serializable; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class NovaCloudPipe implements Serializable { - - @JsonProperty("project_id") - private String projectId; - - private String state; - - @JsonProperty("instance_id") - private String instanceId; - - @JsonProperty("createdAt") - private String createdAt; - - @JsonProperty("internal_ip") - private String internalIp; - - @JsonProperty("public_ip") - private String publicIp; - - @JsonProperty("public_port") - private String publicPort; - -} diff --git a/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipeForCreate.java b/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipeForCreate.java deleted file mode 100644 index 979849557..000000000 --- a/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipeForCreate.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.cloudpipe; - -import java.io.Serializable; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - - -@JsonRootName("cloudpipe") -public class NovaCloudPipeForCreate implements Serializable { - - @JsonProperty("project_id") - private String projectId; - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipes.java b/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipes.java deleted file mode 100644 index 396b04312..000000000 --- a/src/main/java/org/openstack/model/compute/nova/cloudpipe/NovaCloudPipes.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.openstack.model.compute.nova.cloudpipe; - -import java.util.ArrayList; -import java.util.List; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class NovaCloudPipes { - - @JsonProperty("cloudpipes") - private List list = new ArrayList(); - - public List getList() { - return list; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/diskconfig/DiskConfigAttributes.java b/src/main/java/org/openstack/model/compute/nova/diskconfig/DiskConfigAttributes.java deleted file mode 100644 index c21c04358..000000000 --- a/src/main/java/org/openstack/model/compute/nova/diskconfig/DiskConfigAttributes.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.openstack.model.compute.nova.diskconfig; - -import javax.xml.bind.annotation.XmlAttribute; - -public class DiskConfigAttributes { - @XmlAttribute - public String diskConfig; - - @Override - public String toString() { - return "DiskConfigAttributes [diskConfig=" + diskConfig + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/diskconfig/package-info.java b/src/main/java/org/openstack/model/compute/nova/diskconfig/package-info.java deleted file mode 100644 index 270995178..000000000 --- a/src/main/java/org/openstack/model/compute/nova/diskconfig/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@XmlSchema(namespace = "http://docs.openstack.org/compute/ext/disk_config/api/v1.1", elementFormDefault = XmlNsForm.QUALIFIED) -package org.openstack.model.compute.nova.diskconfig; - -import javax.xml.bind.annotation.XmlNsForm; -import javax.xml.bind.annotation.XmlSchema; - diff --git a/src/main/java/org/openstack/model/compute/nova/extendedstatus/ExtendedStatusAttributes.java b/src/main/java/org/openstack/model/compute/nova/extendedstatus/ExtendedStatusAttributes.java deleted file mode 100644 index 24474a3b2..000000000 --- a/src/main/java/org/openstack/model/compute/nova/extendedstatus/ExtendedStatusAttributes.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openstack.model.compute.nova.extendedstatus; - -import javax.xml.bind.annotation.XmlAttribute; - -public class ExtendedStatusAttributes { - @XmlAttribute(name = "vm_state") - public String vmState; - - @XmlAttribute(name = "task_state") - public String taskState; - - @XmlAttribute(name = "power_state") - public String powerState; - - @Override - public String toString() { - return "ExtendedStatusAttributes [vmState=" + vmState + ", taskState=" + taskState + ", powerState=" + powerState + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/extendedstatus/package-info.java b/src/main/java/org/openstack/model/compute/nova/extendedstatus/package-info.java deleted file mode 100644 index c8bb84256..000000000 --- a/src/main/java/org/openstack/model/compute/nova/extendedstatus/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -@XmlSchema(namespace = "http://docs.openstack.org/compute/ext/extended_status/api/v1.1", elementFormDefault = XmlNsForm.QUALIFIED) -package org.openstack.model.compute.nova.extendedstatus; - -import javax.xml.bind.annotation.XmlNsForm; -import javax.xml.bind.annotation.XmlSchema; - diff --git a/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIp.java b/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIp.java deleted file mode 100644 index 74e9fa8b7..000000000 --- a/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIp.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.openstack.model.compute.nova.floatingip; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.FloatingIp; - -@XmlRootElement(name = "floating_ip", namespace = "") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("floating_ip") -public class NovaFloatingIp implements Serializable, FloatingIp { - - @XmlAttribute - private Integer id; - - @XmlAttribute - private String ip; - - @XmlAttribute - private String pool; - - @XmlAttribute(name = "instance_id") - @JsonProperty("instance_id") - private String instanceId; - - @XmlAttribute(name = "fixed_ip") - @JsonProperty("fixed_ip") - private String fixedIp; - - public NovaFloatingIp() { - - } - - public NovaFloatingIp(Integer id, String ip, String fixedIp, String pool, String instanceId) { - this.id = id; - this.ip = ip; - this.fixedIp = fixedIp; - this.pool = pool; - this.instanceId = instanceId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.floatingip.FloatingIp#getId() - */ - @Override - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.floatingip.FloatingIp#getIp() - */ - @Override - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.floatingip.FloatingIp#getPool() - */ - @Override - public String getPool() { - return pool; - } - - public void setPool(String pool) { - this.pool = pool; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.floatingip.FloatingIp#getInstanceId() - */ - @Override - public String getInstanceId() { - return instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.floatingip.FloatingIp#getFixedIp() - */ - @Override - public String getFixedIp() { - return fixedIp; - } - - public void setFixedIp(String fixedIp) { - this.fixedIp = fixedIp; - } - - @Override - public String toString() { - return "NovaFloatingIp [id=" + id + ", ip=" + ip + ", pool=" + pool - + ", instanceId=" + instanceId + ", fixedIp=" + fixedIp + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpList.java b/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpList.java deleted file mode 100644 index f553a50de..000000000 --- a/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpList.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.openstack.model.compute.nova.floatingip; - -import java.io.Serializable; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.compute.FloatingIp; -import org.openstack.model.compute.FloatingIpList; - -@XmlRootElement(name="floating_ips", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaFloatingIpList implements Serializable, FloatingIpList { - - @XmlElementWrapper(name = "floating_ips") - @XmlElement(name = "floating_ip") - @JsonProperty("floating_ips") - @JsonDeserialize(as=List.class, contentAs=NovaFloatingIp.class) - private List list; - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.floatingip.FloatingIpList#getList() - */ - @Override - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - -} - diff --git a/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpPool.java b/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpPool.java deleted file mode 100644 index 397e7a1df..000000000 --- a/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpPool.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.openstack.model.compute.nova.floatingip; - -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("floating_ip_pool") -public class NovaFloatingIpPool { - - private String value; - -} diff --git a/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpPoolList.java b/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpPoolList.java deleted file mode 100644 index 820029e1e..000000000 --- a/src/main/java/org/openstack/model/compute/nova/floatingip/NovaFloatingIpPoolList.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.model.compute.nova.floatingip; - -import java.util.List; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class NovaFloatingIpPoolList { - - @JsonProperty("floating_ip_pools") - //@JsonDeserialize(as=List.class, contentAs=NovaFloatingIp.class) - private List list; - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/floatingipdns/DnsEntry.java b/src/main/java/org/openstack/model/compute/nova/floatingipdns/DnsEntry.java deleted file mode 100644 index 282396a78..000000000 --- a/src/main/java/org/openstack/model/compute/nova/floatingipdns/DnsEntry.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openstack.model.compute.nova.floatingipdns; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("dns_entry") -public class DnsEntry { - - private String id; - - private String name; - - private String ip; - - private String domain; - - private String type; - - @JsonProperty("dns_type") - private String dnsType; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - public String getDomain() { - return domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDnsType() { - return dnsType; - } - - public void setDnsType(String dnsType) { - this.dnsType = dnsType; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/floatingipdns/DomainEntry.java b/src/main/java/org/openstack/model/compute/nova/floatingipdns/DomainEntry.java deleted file mode 100644 index 5cf7fb90c..000000000 --- a/src/main/java/org/openstack/model/compute/nova/floatingipdns/DomainEntry.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.openstack.model.compute.nova.floatingipdns; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("domain_entry") -public class DomainEntry { - - private String scope; - - private String project; - - private String domain; - - @JsonProperty("availability_zone") - private String availabilityZone; - - public String getScope() { - return scope; - } - - public void setScope(String scope) { - this.scope = scope; - } - - public String getProject() { - return project; - } - - public void setProject(String project) { - this.project = project; - } - - public String getDomain() { - return domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - - public String getAvailabilityZone() { - return availabilityZone; - } - - public void setAvailabilityZone(String availabilityZone) { - this.availabilityZone = availabilityZone; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/floatingipdns/FloatingIpDns.java b/src/main/java/org/openstack/model/compute/nova/floatingipdns/FloatingIpDns.java deleted file mode 100644 index 0c6ec1440..000000000 --- a/src/main/java/org/openstack/model/compute/nova/floatingipdns/FloatingIpDns.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.openstack.model.compute.nova.floatingipdns; - -import java.io.Serializable; - -public class FloatingIpDns implements Serializable { - - private String ip; - - private String type; - - private String name; - - private String domain; - - public String getIp() { - return ip; - } - - public void setIp(String ip) { - this.ip = ip; - } - - 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 String getDomain() { - return domain; - } - - public void setDomain(String domain) { - this.domain = domain; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/floatingipdns/FloatingIpsDns.java b/src/main/java/org/openstack/model/compute/nova/floatingipdns/FloatingIpsDns.java deleted file mode 100644 index 54dbdddc6..000000000 --- a/src/main/java/org/openstack/model/compute/nova/floatingipdns/FloatingIpsDns.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openstack.model.compute.nova.floatingipdns; - -import java.util.ArrayList; -import java.util.List; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class FloatingIpsDns { - - @JsonProperty("domain_entries") - private List list = new ArrayList(); - -} diff --git a/src/main/java/org/openstack/model/compute/nova/host/NovaHost.java b/src/main/java/org/openstack/model/compute/nova/host/NovaHost.java deleted file mode 100644 index 0c14ae4f5..000000000 --- a/src/main/java/org/openstack/model/compute/nova/host/NovaHost.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openstack.model.compute.nova.host; - -import java.util.ArrayList; -import java.util.List; - -import org.codehaus.jackson.annotate.JsonProperty; - -import com.google.common.base.Function; -import com.google.common.collect.Lists; - -public class NovaHost { - - - - public static class Resource { - - private String project; - - @JsonProperty("memory_mb") - private Integer memoryMb; - - private String host; - - private Integer cpu; - - @JsonProperty("disk_gb") - private Integer diskGb; - - public String getProject() { - return project; - } - - public Integer getMemoryMb() { - return memoryMb; - } - - public String getHost() { - return host; - } - - public Integer getCpu() { - return cpu; - } - - public Integer getDiskGb() { - return diskGb; - } - - @Override - public String toString() { - return "Resource [project=" + project + ", memoryMb=" + memoryMb - + ", host=" + host + ", cpu=" + cpu + ", diskGb=" + diskGb - + "]"; - } - - } - - public static class ResourceWrapper { - - private Resource resource; - - public Resource getResource() { - return resource; - } - - } - - @JsonProperty("host") - private List resources = new ArrayList(); - - public List getResources() { - return Lists.transform(resources, new Function() { - - @Override - public Resource apply(ResourceWrapper wrapper) { - return wrapper.resource; - } - - }); - } - - @Override - public String toString() { - return "NovaHost [resources=" + getResources() + "]"; - } - - - -} diff --git a/src/main/java/org/openstack/model/compute/nova/host/NovaHostList.java b/src/main/java/org/openstack/model/compute/nova/host/NovaHostList.java deleted file mode 100644 index 2c9c423a6..000000000 --- a/src/main/java/org/openstack/model/compute/nova/host/NovaHostList.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.openstack.model.compute.nova.host; - -import java.util.ArrayList; -import java.util.List; - -public class NovaHostList { - - private List hosts = new ArrayList(); - - public List getHosts() { - return hosts; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/host/UpdateNovaHostRequest.java b/src/main/java/org/openstack/model/compute/nova/host/UpdateNovaHostRequest.java deleted file mode 100644 index 48f36fc38..000000000 --- a/src/main/java/org/openstack/model/compute/nova/host/UpdateNovaHostRequest.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openstack.model.compute.nova.host; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class UpdateNovaHostRequest { - - @JsonProperty - private String status; - - @JsonProperty("maintenance_mode") - private String maintenanceMode; - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - public String getMaintenanceMode() { - return maintenanceMode; - } - - public void setMaintenanceMode(String maintenanceMode) { - this.maintenanceMode = maintenanceMode; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/jaxb.index b/src/main/java/org/openstack/model/compute/nova/jaxb.index deleted file mode 100644 index c1091a153..000000000 --- a/src/main/java/org/openstack/model/compute/nova/jaxb.index +++ /dev/null @@ -1,28 +0,0 @@ -NovaAddresses -NovaBadRequest -NovaConsole -NovaConsoleList -NovaCreateFloatingIpResponse -NovaCreateSecurityGroupRuleRequest -NovaErrorResponse -NovaFault -NovaFlavor -NovaFlavorList -NovaFloatingIp -NovaFloatingIpList -NovaImage -NovaImageList -NovaItemNotFound -NovaKeyPair -NovaKeyPairList -NovaMetadata -NovaSecurityGroup -NovaSecurityGroupList -NovaSecurityGroupRule -NovaServer -NovaServerForCreate -NovaServerList -NovaSnapshot -NovaSnapshotList -NovaVolume -NovaVolumeList \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/nova/keypair/NovaCreateKeyPairResponse.java b/src/main/java/org/openstack/model/compute/nova/keypair/NovaCreateKeyPairResponse.java deleted file mode 100644 index cfc591872..000000000 --- a/src/main/java/org/openstack/model/compute/nova/keypair/NovaCreateKeyPairResponse.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.keypair; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.openstack.model.compute.KeyPair; - -@XmlAccessorType(XmlAccessType.NONE) -@XmlRootElement(name = "keypair") -public class NovaCreateKeyPairResponse { - @XmlElement(name = "keypair") - KeyPair keypair; - - public KeyPair getKeyPair() { - return keypair; - } - - public void setKeyPair(KeyPair keypair) { - this.keypair = keypair; - } -} diff --git a/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPair.java b/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPair.java deleted file mode 100644 index d044b15be..000000000 --- a/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPair.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.openstack.model.compute.nova.keypair; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.KeyPair; - -// TODO: Rename to KeyPairInfo? - -@XmlRootElement(name="keypair", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("keypair") -public class NovaKeyPair implements Serializable, KeyPair { - - @XmlElement(required=true, namespace="") - private String name; - - @XmlElement(name="public_key", namespace="") - @JsonProperty("public_key") - private String publicKey; - - @XmlElement(namespace="") - private String fingerprint; - - @XmlElement(name="user_id") - @JsonProperty("user_id") - private String userId; - - @XmlElement(name="private_key") - @JsonProperty("private_key") - private String privateKey; - - public NovaKeyPair() { - // TODO Auto-generated constructor stub - } - - public NovaKeyPair(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.KeyPair#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.KeyPair#getPublicKey() - */ - @Override - public String getPublicKey() { - return publicKey; - } - - public void setPublicKey(String publicKey) { - this.publicKey = publicKey; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.KeyPair#getFingerprint() - */ - @Override - public String getFingerprint() { - return fingerprint; - } - - public void setFingerprint(String fingerprint) { - this.fingerprint = fingerprint; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.KeyPair#getUserId() - */ - @Override - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId; - } - - @Override - public String toString() { - return "KeyPair [name=" + name + ", publicKey=" + publicKey - + ", fingerprint=" + fingerprint + "]"; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.KeyPair#getPrivateKey() - */ - @Override - public String getPrivateKey() { - return privateKey; - } - - public void setPrivateKey(String privateKey) { - this.privateKey = privateKey; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPairList.java b/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPairList.java deleted file mode 100644 index 4ea7409c6..000000000 --- a/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPairList.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.openstack.model.compute.nova.keypair; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.compute.KeyPairList; -import org.openstack.model.compute.KeyPairListItem; - -@XmlRootElement(name = "keypairs", namespace = "") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaKeyPairList implements Serializable, KeyPairList { - - @XmlElement(name = "keypair", namespace = "") - @JsonProperty("keypairs") - @JsonDeserialize(as=List.class, contentAs=NovaKeyPairListItem.class) - private List list = new ArrayList(); - - - /* (non-Javadoc) - * @see org.openstack.model.compute.KeyPairList#getList() - */ - @Override - public List getList() { - return list; - } - - @Override - public String toString() { - return "NovaKeyPairList [list=" + list + "]"; - } -} diff --git a/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPairListItem.java b/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPairListItem.java deleted file mode 100644 index 9d1a320a9..000000000 --- a/src/main/java/org/openstack/model/compute/nova/keypair/NovaKeyPairListItem.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openstack.model.compute.nova.keypair; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.compute.KeyPair; -import org.openstack.model.compute.KeyPairListItem; - -@XmlAccessorType(XmlAccessType.NONE) -public class NovaKeyPairListItem implements Serializable, KeyPairListItem { - - @XmlElement(name = "keypair") - @JsonDeserialize(as=NovaKeyPair.class) - KeyPair keypair; - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.keypair.KeyPairListItem#getKeypair() - */ - @Override - public KeyPair getKeypair() { - return keypair; - } - - public void setKeypair(NovaKeyPair keypair) { - this.keypair = keypair; - } - - @Override - public String toString() { - return "KeyPairListItem [keypair=" + keypair + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/network/NovaNetwork.java b/src/main/java/org/openstack/model/compute/nova/network/NovaNetwork.java deleted file mode 100644 index 52f88626f..000000000 --- a/src/main/java/org/openstack/model/compute/nova/network/NovaNetwork.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openstack.model.compute.nova.network; - -import java.io.Serializable; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class NovaNetwork implements Serializable { - - @JsonProperty("id") - private String id; - - @JsonProperty("project_id") - private String tenantId; - - @JsonProperty("multi_host") - private String multiHost; - - @JsonProperty("host") - private String host; - - @JsonProperty("vlan") - private String vlan; - - @JsonProperty("broadcast") - private String broadcast; - - @JsonProperty("netmask") - private String netmask; - - @JsonProperty("bridge") - private String bridge; - - @JsonProperty("bridge_interface") - private String bridgeInterface; - - @JsonProperty("dhcp_start") - private String dhcpStart; - - @JsonProperty("created_at") - private String createdAt; - - @JsonProperty("updated_at") - private String updatedAt; - - @JsonProperty("deleted_at") - private String deletedAt; - - @JsonProperty("gateway") - private String gateway; - - @JsonProperty("gateway_v6") - private String gatewayV6; - - @JsonProperty("netmask_v6") - private String netmaskV6; - - @JsonProperty("label") - private String label; - - - - @JsonProperty("vpn_public_address") - private String vnpPublicAddress; - - @JsonProperty("vpn_public_port") - private String vpnPublicPort; - - @JsonProperty("vpn_private_address") - private String vpnPrivateAddress; - - @JsonProperty("deleted") - private String deleted; - - @JsonProperty("injected") - private String injected; - - @JsonProperty("cidr") - private String cidr; - - @JsonProperty("cidr_v6") - private String cidrv6; - - @JsonProperty("dns1") - private String dns1; - -} diff --git a/src/main/java/org/openstack/model/compute/nova/package-info.java b/src/main/java/org/openstack/model/compute/nova/package-info.java deleted file mode 100644 index d2563cf7a..000000000 --- a/src/main/java/org/openstack/model/compute/nova/package-info.java +++ /dev/null @@ -1,11 +0,0 @@ -@XmlSchema(namespace = "http://docs.openstack.org/compute/api/v1.1", - xmlns = { - @XmlNs(namespaceURI = "http://docs.openstack.org/compute/api/v1.1", prefix = "") - }, - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) - -package org.openstack.model.compute.nova; - -import javax.xml.bind.annotation.XmlNs; -import javax.xml.bind.annotation.XmlSchema; - diff --git a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroup.java b/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroup.java deleted file mode 100644 index 96af67239..000000000 --- a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroup.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.openstack.model.compute.nova.securitygroup; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.atom.Link; -import org.openstack.model.compute.SecurityGroup; -import org.openstack.model.compute.SecurityGroupRule; - -@XmlRootElement(name = "security_group") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("security_group") -public class NovaSecurityGroup implements SecurityGroup, Serializable { - - @XmlAttribute - protected Integer id; - - @XmlAttribute(name = "tenant_id") - @JsonProperty("tenant_id") - protected String tenantId; - - // The name shifts from being an element to being an attribute; sigh - // I think it's an element when we're creating a server, and an attribute when we're creating a group - // We pass both (the same) and accept either. - // TODO: Get this fixed - protected String name; - - @XmlElement - protected String description; - - @XmlElementWrapper(name = "rules") - @XmlElement(name = "rule") - @JsonDeserialize(as=List.class, contentAs=NovaSecurityGroupRule.class) - protected List rules = new ArrayList(); - - @XmlElement(name = "link", namespace = "http://www.w3.org/2005/Atom") - private List links; - - public NovaSecurityGroup() { - // TODO Auto-generated constructor stub - } - - public NovaSecurityGroup(int id, String name, String description) { - this.id = id; - this.name = name; - this.description = description; - } - - @Override - public Integer getId() { - return id; - } - - @Override - public void setId(Integer id) { - this.id = id; - } - - @Override - public String getTenantId() { - return tenantId; - } - - @Override - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - @Override - public String getName() { - return name; - } - - @Override - public void setName(String name) { - this.name = name; - } - - @Override - public String getDescription() { - return description; - } - - @Override - public void setDescription(String description) { - this.description = description; - } - - @Override - public List getRules() { - return rules; - } - - @Override - public void setRules(List rules) { - this.rules = rules; - } - - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupForCreate.java b/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupForCreate.java deleted file mode 100644 index 7c3d096c0..000000000 --- a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupForCreate.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.openstack.model.compute.nova.securitygroup; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.SecurityGroupForCreate; - -@XmlRootElement(name = "security_group") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("security_group") -public class NovaSecurityGroupForCreate implements Serializable, SecurityGroupForCreate { - - @XmlAttribute - protected String name; - - @XmlAttribute - protected String description; - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupForCreate#getName() - */ - @Override - public String getName() { - return name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupForCreate#setName(java.lang.String) - */ - @Override - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupForCreate#getDescription() - */ - @Override - public String getDescription() { - return description; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupForCreate#setDescription(java.lang.String) - */ - @Override - public void setDescription(String description) { - this.description = description; - } - - @Override - public String toString() { - return "NovaSecurityGroupForCreate [name=" + name + ", description=" + description + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupList.java b/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupList.java deleted file mode 100644 index 8d8c46e9c..000000000 --- a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupList.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.openstack.model.compute.nova.securitygroup; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.compute.SecurityGroup; -import org.openstack.model.compute.SecurityGroupList; - -@XmlRootElement(name = "security_groups") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaSecurityGroupList implements Serializable, SecurityGroupList { - - @XmlElementWrapper(name = "security_groups") - @XmlElement(name = "security_group") - @JsonProperty("security_groups") - @JsonDeserialize(as=List.class, contentAs=NovaSecurityGroup.class) - private List list = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.compute.SecurityGroupList#getList() - */ - @Override - public List getList() { - return list; - } - - @Override - public String toString() { - return "NovaSecurityGroupList [list=" + list + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupRule.java b/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupRule.java deleted file mode 100644 index 6a0354b10..000000000 --- a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupRule.java +++ /dev/null @@ -1,183 +0,0 @@ -package org.openstack.model.compute.nova.securitygroup; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.SecurityGroupRule; - -@XmlRootElement(name = "security_group_rule") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("security_group_rule") -public class NovaSecurityGroupRule implements SecurityGroupRule, Serializable { - - @XmlAccessorType(XmlAccessType.NONE) - public static final class Group implements Serializable { - - @XmlElement - private String name; - - @XmlElement(name = "tenant_id") - @JsonProperty("tenant_id") - private String tenantId; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - @Override - public String toString() { - return "Group [name=" + name + ", tenantId=" + tenantId + "]"; - } - - } - - @XmlAccessorType(XmlAccessType.NONE) - public static final class IpRange implements Serializable { - - @XmlElement - private String cidr; - - public String getCidr() { - return cidr; - } - - public void setCidr(String cidr) { - this.cidr = cidr; - } - - @Override - public String toString() { - return "IpRange [cidr=" + cidr + "]"; - } - - } - - @XmlAttribute - private Integer id; - - @XmlAttribute - private String name; - - @XmlElement(name = "parent_group_id", required = true) - @JsonProperty("parent_group_id") - private Integer parentGroupId; - - @XmlElement(name = "from_port") - @JsonProperty("from_port") - private Integer fromPort; - - @XmlElement(name = "to_port") - @JsonProperty("to_port") - private Integer toPort; - - @XmlElement(name = "ip_protocol") - @JsonProperty("ip_protocol") - private String ipProtocol; - - @XmlElement(name = "ip_range") - @JsonProperty("ip_range") - private IpRange ipRange = new IpRange(); - - @XmlElement - private Group group; - - @Override - public Integer getId() { - return id; - } - - @Override - public void setId(Integer id) { - this.id = id; - } - - @Override - public String getName() { - return name; - } - - @Override - public void setName(String name) { - this.name = name; - } - - @Override - public Integer getParentGroupId() { - return parentGroupId; - } - - @Override - public void setParentGroupId(Integer parentGroupId) { - this.parentGroupId = parentGroupId; - } - - @Override - public Integer getFromPort() { - return fromPort; - } - - @Override - public void setFromPort(Integer fromPort) { - this.fromPort = fromPort; - } - - @Override - public Integer getToPort() { - return toPort; - } - - @Override - public void setToPort(Integer toPort) { - this.toPort = toPort; - } - - @Override - public String getIpProtocol() { - return ipProtocol; - } - - @Override - public void setIpProtocol(String ipProtocol) { - this.ipProtocol = ipProtocol; - } - - @Override - public IpRange getIpRange() { - return ipRange; - } - - @Override - public void setIpRange(IpRange ipRange) { - this.ipRange = ipRange; - } - - @Override - public Group getGroup() { - return group; - } - - @Override - public void setGroup(Group group) { - this.group = group; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupRuleForCreate.java b/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupRuleForCreate.java deleted file mode 100644 index d965e98fa..000000000 --- a/src/main/java/org/openstack/model/compute/nova/securitygroup/NovaSecurityGroupRuleForCreate.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.openstack.model.compute.nova.securitygroup; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.SecurityGroupRuleForCreate; - -@XmlRootElement(name = "security_group_rule") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("security_group_rule") -public class NovaSecurityGroupRuleForCreate implements Serializable, SecurityGroupRuleForCreate { - - @XmlElement(name="parent_group_id", required=true) - @JsonProperty("parent_group_id") - private Integer parentGroupId; - - @XmlElement(name="from_port") - @JsonProperty("from_port") - private Integer fromPort; - - @XmlElement(name="to_port") - @JsonProperty("to_port") - private Integer toPort; - - @XmlElement(name="ip_protocol") - @JsonProperty("ip_protocol") - private String ipProtocol; - - @XmlElement - private String cidr; - - @XmlElement(name="group_id") - @JsonProperty("group_id") - private Integer groupId; - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#getParentGroupId() - */ - @Override - public Integer getParentGroupId() { - return parentGroupId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#setParentGroupId(java.lang.Integer) - */ - @Override - public void setParentGroupId(Integer parentGroupId) { - this.parentGroupId = parentGroupId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#getFromPort() - */ - @Override - public Integer getFromPort() { - return fromPort; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#setFromPort(java.lang.Integer) - */ - @Override - public void setFromPort(Integer fromPort) { - this.fromPort = fromPort; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#getToPort() - */ - @Override - public Integer getToPort() { - return toPort; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#setToPort(java.lang.Integer) - */ - @Override - public void setToPort(Integer toPort) { - this.toPort = toPort; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#getIpProtocol() - */ - @Override - public String getIpProtocol() { - return ipProtocol; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#setIpProtocol(java.lang.String) - */ - @Override - public void setIpProtocol(String ipProtocol) { - this.ipProtocol = ipProtocol; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#getCidr() - */ - @Override - public String getCidr() { - return cidr; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#setCidr(java.lang.String) - */ - @Override - public void setCidr(String cidr) { - this.cidr = cidr; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#getGroupId() - */ - @Override - public Integer getGroupId() { - return groupId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.securitygroup.SecurityGroupRuleForCreate#setGroupId(java.lang.Integer) - */ - @Override - public void setGroupId(Integer groupId) { - this.groupId = groupId; - } - - @Override - public String toString() { - return "SecurityGroupRule [parentGroupId=" + parentGroupId - + ", fromPort=" + fromPort + ", toPort=" + toPort - + ", ipProtocol=" + ipProtocol + ", cidr=" + cidr - + ", groupId=" + groupId + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/AddFixedIpAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/AddFixedIpAction.java deleted file mode 100644 index 1cdbf73ec..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/AddFixedIpAction.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="addFixedIp") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("addFixedIp") -public class AddFixedIpAction implements Serializable, ServerAction { - - @XmlAttribute - private String networkId; - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - - - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/AssociateFloatingIpAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/AssociateFloatingIpAction.java deleted file mode 100644 index 815d6521a..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/AssociateFloatingIpAction.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@JsonRootName("addFloatingIp") -public class AssociateFloatingIpAction implements Serializable, ServerAction { - - private String address; - - public AssociateFloatingIpAction(String address) { - this.address = address; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/ChangePasswordAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/ChangePasswordAction.java deleted file mode 100644 index 8aaa1eeba..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/ChangePasswordAction.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="changePassword") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("changePassword") -public class ChangePasswordAction implements Serializable, ServerAction { - - @XmlAttribute(required=true) - private String adminPass; - - public ChangePasswordAction() { - - } - - public ChangePasswordAction(String adminPass) { - this.adminPass = adminPass; - } - - public String getAdminPass() { - return adminPass; - } - - public void setAdminPass(String adminPass) { - this.adminPass = adminPass; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/ConfirmResizeAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/ConfirmResizeAction.java deleted file mode 100644 index f40c6b4bb..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/ConfirmResizeAction.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -/** - * During a resize operation, the original server is saved for a period of time to allow roll back if a problem exists. - * - * Once the newly resized server is tested and has been confirmed to be functioning properly, use this operation to confirm the resize. - * - * After confirmation, the original server is removed and cannot be rolled back to. - * - * All resizes are automatically confirmed after 24 hours if they are not explicitly confirmed or reverted. - * - * @author luis@woorea.es - * - */ -@XmlRootElement(name="confirmResize") -@JsonRootName("confirmResize") -public class ConfirmResizeAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/Console.java b/src/main/java/org/openstack/model/compute/nova/server/actions/Console.java deleted file mode 100644 index 73f11d4fa..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/Console.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; - -@XmlRootElement(name="console", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("console") -public class Console implements Serializable { - - @XmlElement - private String url; - - @XmlElement - private String type; - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - @Override - public String toString() { - return "Console [url=" + url + ", type=" + type + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/CreateBackupAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/CreateBackupAction.java deleted file mode 100644 index 3dfc8c291..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/CreateBackupAction.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="createBackup") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("createBackup") -public class CreateBackupAction implements Serializable, ServerAction { - - @XmlAttribute - private String name; - - @XmlAttribute(name="backup_type") - private String type; - - @XmlAttribute - private String rotation; - - @XmlElement - private Map metadata; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getRotation() { - return rotation; - } - - public void setRotation(String rotation) { - this.rotation = rotation; - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - @Override - public String toString() { - return "CreateBackupAction [name=" + name + ", type=" + type - + ", rotation=" + rotation + ", metadata=" + metadata + "]"; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/CreateImageAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/CreateImageAction.java deleted file mode 100644 index 1c19400c6..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/CreateImageAction.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; - -/** - * This operation creates a new image for the given server. - * - * Once complete, a new image will be available that can be used to rebuild or create servers. - * - * @author luis@woorea.es - * - */ -@XmlRootElement(name="createImage") -@JsonRootName("createImage") -public class CreateImageAction implements Serializable, ServerAction { - - private String name; - - private Map metadata = new HashMap(); - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - @Override - public Class getReturnType() { - return String.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/DisassociateFloatingIpAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/DisassociateFloatingIpAction.java deleted file mode 100644 index 9afacfe8b..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/DisassociateFloatingIpAction.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@JsonRootName("removeFloatingIp") -public class DisassociateFloatingIpAction implements Serializable, ServerAction { - - private String address; - - public DisassociateFloatingIpAction(String address) { - this.address = address; - } - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/ForceDeleteAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/ForceDeleteAction.java deleted file mode 100644 index 5d16e2ac7..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/ForceDeleteAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="forceDelete") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("forceDelete") -public class ForceDeleteAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/GetConsoleOutputAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/GetConsoleOutputAction.java deleted file mode 100644 index 510fc8d7a..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/GetConsoleOutputAction.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonIgnore; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; - -@XmlRootElement(name="os-getConsoleOutput") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("os-getConsoleOutput") -public class GetConsoleOutputAction implements Serializable, ServerAction { - - @XmlElement(required=true) - private Integer length; - - public Integer getLength() { - return length; - } - - public void setLength(Integer length) { - this.length = length; - } - - @Override - @JsonIgnore(true) - public Class getReturnType() { - return Output.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/GetVncConsoleAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/GetVncConsoleAction.java deleted file mode 100644 index 0bed6d963..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/GetVncConsoleAction.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; - -@XmlRootElement(name="os-getVNCConsole") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("os-getVNCConsole") -public class GetVncConsoleAction implements Serializable, ServerAction { - - /** - * 'xvpvnc' for XVP-like vnc clients - * - * 'novnc' for HTML5 websockets - * - */ - @XmlElement(required=true) - private String type = "novnc"; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - @Override - public Class getReturnType() { - return Console.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/InjectNetworkInfoAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/InjectNetworkInfoAction.java deleted file mode 100644 index 35d6d6a9c..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/InjectNetworkInfoAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="injectNetworkInfo") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("injectNetworkInfo") -public class InjectNetworkInfoAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/LockAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/LockAction.java deleted file mode 100644 index 85c1c5301..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/LockAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="lock") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("lock") -public class LockAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/MigrateAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/MigrateAction.java deleted file mode 100644 index 66116f598..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/MigrateAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="migrate") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("migrate") -public class MigrateAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/Output.java b/src/main/java/org/openstack/model/compute/nova/server/actions/Output.java deleted file mode 100644 index 425fa69d5..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/Output.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlValue; - -import org.codehaus.jackson.annotate.JsonProperty; - -@XmlRootElement(name="output", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -public class Output implements Serializable { - - @XmlValue - @JsonProperty - private String output; - - public String getOutput() { - return output; - } - - public void setOutput(String output) { - this.output = output; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/PauseAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/PauseAction.java deleted file mode 100644 index 94a7f1010..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/PauseAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="pause") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("pause") -public class PauseAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/RebootAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/RebootAction.java deleted file mode 100644 index b706b15c9..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/RebootAction.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - - -/** - * This operation enables you to complete either a soft or hard reboot of a specified server. With a soft reboot (SOFT), - * the operating system is signaled to restart, which allows for a graceful shutdown of all processes. A hard reboot (HARD) - * is the equivalent of power cycling the server. - * - * @author luis@woorea.es - * - */ -@XmlRootElement(name="reboot") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("reboot") -public class RebootAction implements Serializable, ServerAction { - - @XmlAttribute(required=true) - private String type; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public RebootAction() { - - } - - public RebootAction(String type) { - this.type = type; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/RebuildAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/RebuildAction.java deleted file mode 100644 index 03deb4ba0..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/RebuildAction.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; -import org.openstack.model.compute.nova.NovaServerForCreate; - -/** - * The rebuild operation removes all data on the server and replaces it with the specified image. - * - * The serverRef and all IP addresses will remain the same. - * - * If name, metadata, accessIPv4, or accessIPv6 are specified, they will replace existing values, otherwise they do not change. - * - * A rebuild operation always removes data injected into the file system through server personality. - * - * You can reinsert data into the file system during the rebuild. - * @author luis@woorea.es - * - */ -@XmlRootElement(name="rebuild") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("rebuild") -public class RebuildAction implements Serializable, ServerAction { - - @XmlAttribute - private String name; - - @XmlAttribute(name="auto_disk_config") - private boolean autoDiskConfig; - - @XmlElement - private Map metadata = new HashMap(); - - @XmlElementWrapper(name = "personality") - @XmlElement(name = "file") - private List personality = new ArrayList(); - - @XmlElement - private String imageRef; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public boolean getAutoDiskConfig() { - return autoDiskConfig; - } - - public void setAutoDiskConfig(boolean autoDiskConfig) { - this.autoDiskConfig = autoDiskConfig; - } - - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - public List getPersonality() { - return personality; - } - - public void setPersonality(List personality) { - this.personality = personality; - } - - public String getImageRef() { - return imageRef; - } - - public void setImageRef(String imageRef) { - this.imageRef = imageRef; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/RemoveFixedIpAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/RemoveFixedIpAction.java deleted file mode 100644 index 947ae77ee..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/RemoveFixedIpAction.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="removeFixedIp") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("removeFixedIp") -public class RemoveFixedIpAction implements Serializable, ServerAction { - - @XmlAttribute - private String address; - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/ResetNetworkAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/ResetNetworkAction.java deleted file mode 100644 index 53abb201b..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/ResetNetworkAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="resetNetwork") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("resetNetwork") -public class ResetNetworkAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/ResizeAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/ResizeAction.java deleted file mode 100644 index 057c81d7b..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/ResizeAction.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -/** - * The resize operation converts an existing server to a different flavor, in essence, scaling the server up or down. - * - * The original server is saved for a period of time to allow rollback if there is a problem. - * - * All resizes should be tested and explicitly confirmed, at which time the original server is removed. - * - * All resizes are automatically confirmed after 24 hours if they are not explicitly confirmed or reverted. - * - * @author luis@woorea.es - * - */ -@XmlRootElement(name="resize") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("resize") -public class ResizeAction implements Serializable, ServerAction { - - @XmlAttribute - private String flavorRef; - - @XmlAttribute(name="auto_disk_config") - @JsonProperty("auto_disk_config") - private boolean autoDiskConfig; - - public String getFlavorRef() { - return flavorRef; - } - - public void setFlavorRef(String flavorRef) { - this.flavorRef = flavorRef; - } - - public boolean getAutoDiskConfig() { - return autoDiskConfig; - } - - public void setAutoDiskConfig(boolean autoDiskConfig) { - this.autoDiskConfig = autoDiskConfig; - } - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/RestoreAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/RestoreAction.java deleted file mode 100644 index 316591cd6..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/RestoreAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="restore") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("restore") -public class RestoreAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/ResumeAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/ResumeAction.java deleted file mode 100644 index d805ed5ef..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/ResumeAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="resume") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("resume") -public class ResumeAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/RevertResize.java b/src/main/java/org/openstack/model/compute/nova/server/actions/RevertResize.java deleted file mode 100644 index 02b6bcf22..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/RevertResize.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -/** - * - * During a resize operation, the original server is saved for a period of time to allow for roll back if there is a problem. - * - * If you determine there is a problem with a newly resized server, use the revert resize operation to revert the resize and roll back to the original server. - * - * All resizes are automatically confirmed after 24 hours if they have not already been confirmed explicitly or reverted. - * - * @author sp - * - */ -@XmlRootElement(name="revertResize") -@JsonRootName("revertResize") -public class RevertResize implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/SuspendAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/SuspendAction.java deleted file mode 100644 index 144e58894..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/SuspendAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="suspend") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("suspend") -public class SuspendAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/UnlockAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/UnlockAction.java deleted file mode 100644 index 8b19fd008..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/UnlockAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="unlock") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("unlock") -public class UnlockAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/server/actions/UnpauseAction.java b/src/main/java/org/openstack/model/compute/nova/server/actions/UnpauseAction.java deleted file mode 100644 index 143b3638b..000000000 --- a/src/main/java/org/openstack/model/compute/nova/server/actions/UnpauseAction.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.compute.nova.server.actions; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.ServerAction; -import org.openstack.model.compute.nova.NovaServer; - -@XmlRootElement(name="unpause") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("unpause") -public class UnpauseAction implements Serializable, ServerAction { - - @Override - public Class getReturnType() { - return NovaServer.class; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshot.java b/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshot.java deleted file mode 100644 index 68a7e178b..000000000 --- a/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshot.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.openstack.model.compute.nova.snapshot; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.Snapshot; - -@XmlRootElement(name = "snapshot", namespace = "") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("snapshot") -public class NovaSnapshot implements Serializable, Snapshot { - - @XmlAttribute - private String id; - - @XmlAttribute - private String status; - - @XmlAttribute(name = "size") - @JsonProperty("size") - private Integer sizeInGB; - - @XmlAttribute(name = "createdAt") - @JsonProperty("createdAt") - private String created; - - @XmlAttribute(name = "displayName") - @JsonProperty("displayName") - private String name; - - @XmlAttribute(name = "displayDescription") - @JsonProperty("displayDescription") - private String description; - - @XmlAttribute(name = "volumeId") - private String volumeId; - - public NovaSnapshot() { - - } - - public NovaSnapshot(String id, String name, String volumeId) { - this.id = id; - this.name = name; - this.volumeId = volumeId; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.compute.nova.snapshot.Snapshot#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.compute.nova.snapshot.Snapshot#getStatus() - */ - @Override - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.compute.nova.snapshot.Snapshot#getSizeInGB() - */ - @Override - public Integer getSizeInGB() { - return sizeInGB; - } - - public void setSizeInGB(Integer sizeInGB) { - this.sizeInGB = sizeInGB; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.compute.nova.snapshot.Snapshot#getCreated() - */ - @Override - public String getCreated() { - return created; - } - - public void setCreated(String created) { - this.created = created; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.compute.nova.snapshot.Snapshot#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.compute.nova.snapshot.Snapshot#getDescription() - */ - @Override - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.compute.nova.snapshot.Snapshot#getVolumeId() - */ - @Override - public String getVolumeId() { - return volumeId; - } - - public void setVolumeId(String volumeId) { - this.volumeId = volumeId; - } - - @Override - public String toString() { - return "NovaSnapshot [id=" + id + ", status=" + status + ", sizeInGB=" - + sizeInGB + ", created=" + created + ", name=" + name - + ", description=" + description + ", volumeId=" + volumeId - + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshotForCreate.java b/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshotForCreate.java deleted file mode 100644 index 82a35ceec..000000000 --- a/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshotForCreate.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openstack.model.compute.nova.snapshot; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.SnapshotForCreate; - - -@XmlRootElement(namespace="") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("snapshot") -public class NovaSnapshotForCreate implements Serializable, SnapshotForCreate { - - @XmlAttribute(name="volume_id") - @JsonProperty("volume_id") - private String volumeId; - - @XmlAttribute - private Boolean force; - - @XmlAttribute(name="display_name") - @JsonProperty("display_name") - private String name; - - @XmlAttribute(name="display_description") - @JsonProperty("display_description") - private String description; - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.snapshot.SnapshotForCreate#getVolumeId() - */ - @Override - public String getVolumeId() { - return volumeId; - } - - public void setVolumeId(String volumeId) { - this.volumeId = volumeId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.snapshot.SnapshotForCreate#getForce() - */ - @Override - public Boolean getForce() { - return force; - } - - public void setForce(Boolean force) { - this.force = force; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.snapshot.SnapshotForCreate#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.snapshot.SnapshotForCreate#getDescription() - */ - @Override - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshotList.java b/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshotList.java deleted file mode 100644 index 25a4fd0ce..000000000 --- a/src/main/java/org/openstack/model/compute/nova/snapshot/NovaSnapshotList.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.openstack.model.compute.nova.snapshot; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.compute.Snapshot; -import org.openstack.model.compute.SnapshotList; - -@XmlRootElement(name="snapshots", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaSnapshotList implements Serializable, SnapshotList { - - @XmlElement(name="snapshot") - @JsonDeserialize(as=List.class, contentAs=NovaSnapshot.class) - private List snapshots = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.compute.SnapshotList#getList() - */ - @Override - public List getList() { - return snapshots; - } - - public void setList(List snapshots) { - this.snapshots = snapshots; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/usage/NovaSimpleTenantUsage.java b/src/main/java/org/openstack/model/compute/nova/usage/NovaSimpleTenantUsage.java deleted file mode 100644 index b323d6b49..000000000 --- a/src/main/java/org/openstack/model/compute/nova/usage/NovaSimpleTenantUsage.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.openstack.model.compute.nova.usage; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("tenant_usage") -public class NovaSimpleTenantUsage implements Serializable { - - public static class NovaServerUsage implements Serializable { - - private BigDecimal hours; - - private BigDecimal uptime; - - @JsonProperty("local_gb") - private BigDecimal localGb; - - @JsonProperty("started_at") - private String startedAt; - - @JsonProperty("ended_at") - private String endedAt; - - @JsonProperty("name") - private String name; - - @JsonProperty("tenant_id") - private String tenantId; - - @JsonProperty("vcpus") - private String vcpus; - - @JsonProperty("memory_mb") - private String memoryMb; - - @JsonProperty("state") - private String state; - - @JsonProperty("flavor") - private String flavor; - - public BigDecimal getHours() { - return hours; - } - - public BigDecimal getUptime() { - return uptime; - } - - public BigDecimal getLocalGb() { - return localGb; - } - - public String getStartedAt() { - return startedAt; - } - - public String getEndedAt() { - return endedAt; - } - - public String getName() { - return name; - } - - public String getTenantId() { - return tenantId; - } - - public String getVcpus() { - return vcpus; - } - - public String getMemoryMb() { - return memoryMb; - } - - public String getState() { - return state; - } - - public String getFlavor() { - return flavor; - } - - } - - @JsonProperty("tenant_id") - private String tenantId; - - @JsonProperty("total_vcpus_usage") - private BigDecimal totalVcpus; - - @JsonProperty("total_memory_mb_usage") - private BigDecimal totalMemoryMb; - - @JsonProperty("total_local_gb_usage") - private BigDecimal totalLocalGbUsage; - - @JsonProperty("total_hours") - private BigDecimal totalHours; - - @JsonProperty("start") - private String start; - - @JsonProperty("stop") - private String stop; - - @JsonProperty("server_usages") - private List serversUsages = new ArrayList(); - - public String getTenantId() { - return tenantId; - } - - public BigDecimal getTotalVcpus() { - return totalVcpus; - } - - public BigDecimal getTotalMemoryMb() { - return totalMemoryMb; - } - - public BigDecimal getTotalLocalGbUsage() { - return totalLocalGbUsage; - } - - public BigDecimal getTotalHours() { - return totalHours; - } - - public String getStart() { - return start; - } - - public String getStop() { - return stop; - } - - public List getServersUsages() { - return serversUsages; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/usage/NovaSimpleTenantUsages.java b/src/main/java/org/openstack/model/compute/nova/usage/NovaSimpleTenantUsages.java deleted file mode 100644 index 3790a7831..000000000 --- a/src/main/java/org/openstack/model/compute/nova/usage/NovaSimpleTenantUsages.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openstack.model.compute.nova.usage; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.codehaus.jackson.annotate.JsonProperty; - -public class NovaSimpleTenantUsages implements Serializable { - - @JsonProperty("tenant_usages") - private List list = new ArrayList(); - - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolume.java b/src/main/java/org/openstack/model/compute/nova/volume/NovaVolume.java deleted file mode 100644 index 893b769cd..000000000 --- a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolume.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.openstack.model.compute.nova.volume; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.compute.Volume; - - -@XmlRootElement(name = "volume", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("volume") -public class NovaVolume implements Serializable, Volume { - - @XmlAttribute - @JsonProperty - private String id; - - @XmlAttribute - @JsonProperty - private String status; - - @XmlAttribute(name="size") - @JsonProperty("size") - private Integer sizeInGB; - - @XmlAttribute(name="availabilityZone") - @JsonProperty - private String availabilityZone; - - @XmlAttribute(name="volumeType") - @JsonProperty("volumeType") - private String type; - - @XmlAttribute(name="createdAt") - @JsonProperty("createdAt") - private String created; - - @XmlAttribute(name="displayName") - @JsonProperty("displayName") - private String name; - - @XmlAttribute(name="displayDescription") - @JsonProperty("displayDescription") - private String description; - - @XmlAttribute(name="snapshotId") - @JsonProperty - private Integer snapshotId; - - @XmlElement(name="metadata") - @JsonProperty - private Map metadata; - - @JsonProperty - private List attachments; - - public NovaVolume() { - - } - - public NovaVolume(String id, String name, Integer snapshotId) { - this.id = id; - this.name = name; - this.snapshotId = snapshotId; - } - - public String getId() { - return id; - } - - public String getStatus() { - return status; - } - - public Integer getSizeInGB() { - return sizeInGB; - } - - public String getAvailabilityZone() { - return availabilityZone; - } - - public String getType() { - return type; - } - - public String getCreated() { - return created; - } - - public String getName() { - return name; - } - - public String getDescription() { - return description; - } - - public Integer getSnapshotId() { - return snapshotId; - } - - public Map getMetadata() { - return metadata; - } - - public List getAttachments() { - return attachments; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeForCreate.java b/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeForCreate.java deleted file mode 100644 index 09ca464e1..000000000 --- a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeForCreate.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.openstack.model.compute.nova.volume; - -import java.io.Serializable; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - - -@XmlRootElement(name = "volume", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("volume") -public class NovaVolumeForCreate implements Serializable, VolumeForCreate { - - @XmlAttribute(name="size") - @JsonProperty("size") - private Integer sizeInGB; - - @XmlAttribute(name="availability_zone") - @JsonProperty("availability_zone") - private String availabilityZone; - - @XmlAttribute(name="display_name") - @JsonProperty("display_name") - private String name; - - @XmlAttribute(name="display_description") - @JsonProperty("display_description") - private String description; - - @JsonProperty("snapshot_id") - private Integer snapshotId; - - private Map metadata; - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.volume.VolumeForCreate#getSizeInGB() - */ - @Override - public Integer getSizeInGB() { - return sizeInGB; - } - - public void setSizeInGB(Integer sizeInGB) { - this.sizeInGB = sizeInGB; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.nova.volume.VolumeForCreate#getAvailabilityZone() - */ - @Override - public String getAvailabilityZone() { - return availabilityZone; - } - - public void setAvailabilityZone(String availabilityZone) { - this.availabilityZone = availabilityZone; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Volume#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Volume#getDescription() - */ - @Override - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Volume#getSnapshotId() - */ - @Override - public Integer getSnapshotId() { - return snapshotId; - } - - public void setSnapshotId(Integer snapshotId) { - this.snapshotId = snapshotId; - } - - /* (non-Javadoc) - * @see org.openstack.model.compute.Volume#getMetadata() - */ - @Override - public Map getMetadata() { - return metadata; - } - - public void setMetadata(Map metadata) { - this.metadata = metadata; - } - - @Override - public String toString() { - return "NovaVolumeForCreate [sizeInGB=" + sizeInGB - + ", availabilityZone=" + availabilityZone + ", name=" + name - + ", description=" + description + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeList.java b/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeList.java deleted file mode 100644 index f3950ab43..000000000 --- a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeList.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.openstack.model.compute.nova.volume; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.compute.Volume; -import org.openstack.model.compute.VolumeList; - -@XmlRootElement(name="volumes", namespace="") -@XmlAccessorType(XmlAccessType.NONE) -public class NovaVolumeList implements Serializable, VolumeList { - - @XmlElement(name="volume") - @JsonProperty("volumes") - @JsonDeserialize(as=List.class, contentAs=NovaVolume.class) - private List list = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.compute.VolumeList#getList() - */ - @Override - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - @Override - public String toString() { - return "NovaVolumeList [list=" + list + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeType.java b/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeType.java deleted file mode 100644 index a52ba6f1b..000000000 --- a/src/main/java/org/openstack/model/compute/nova/volume/NovaVolumeType.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.model.compute.nova.volume; - -import java.io.Serializable; -import java.util.Map; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("volume_type") -public class NovaVolumeType implements Serializable { - - private String name; - - @JsonProperty("extra_specs") - private Map extraSpecs; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Map getExtraSpecs() { - return extraSpecs; - } - - public void setExtraSpecs(Map extraSpecs) { - this.extraSpecs = extraSpecs; - } - -} diff --git a/src/main/java/org/openstack/model/compute/nova/volume/VolumeForCreate.java b/src/main/java/org/openstack/model/compute/nova/volume/VolumeForCreate.java deleted file mode 100644 index f0da27472..000000000 --- a/src/main/java/org/openstack/model/compute/nova/volume/VolumeForCreate.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.openstack.model.compute.nova.volume; - -import java.util.Map; - -public interface VolumeForCreate { - - /* (non-Javadoc) - * @see org.openstack.model.compute.Volume#getSizeInGB() - */ - Integer getSizeInGB(); - - void setSizeInGB(Integer sizeInGb); - - /* (non-Javadoc) - * @see org.openstack.model.compute.Volume#getAvailabilityZone() - */ - String getAvailabilityZone(); - - void setAvailabilityZone(String availabilityZone); - - /* (non-Javadoc) - * @see org.openstack.model.compute.Volume#getName() - */ - String getName(); - - void setName(String name); - - /* (non-Javadoc) - * @see org.openstack.model.compute.Volume#getDescription() - */ - String getDescription(); - - void setDescription(String description); - - Map getMetadata(); - - void setMetadata(Map metadata); - - Integer getSnapshotId(); - - void setSnapshotId(Integer snapshotId); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/exceptions/OpenStackException.java b/src/main/java/org/openstack/model/exceptions/OpenStackException.java deleted file mode 100644 index 5e4a47d52..000000000 --- a/src/main/java/org/openstack/model/exceptions/OpenStackException.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openstack.model.exceptions; - - -public class OpenStackException extends RuntimeException { - - private int status; - - public OpenStackException() { - super(); - // TODO Auto-generated constructor stub - } - - - - public OpenStackException(int status, String message, Throwable cause) { - super(message, cause); - this.status = status; - } - - public OpenStackException(String message) { - super(message); - // TODO Auto-generated constructor stub - } - - public OpenStackException(String message, Throwable e) { - super(message, e); - // TODO Auto-generated constructor stub - } - - - -} diff --git a/src/main/java/org/openstack/model/identity/Access.java b/src/main/java/org/openstack/model/identity/Access.java deleted file mode 100644 index 4007f015f..000000000 --- a/src/main/java/org/openstack/model/identity/Access.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openstack.model.identity; - -import java.util.List; - - -public interface Access { - - Token getToken(); - - //void setToken(Token token); - - List getServices(); - - //void setServices(List services); - - User getUser(); - - public abstract ServiceEndpoint getEndpoint(final String type, final String region); - - //void setUser(User user); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/Authentication.java b/src/main/java/org/openstack/model/identity/Authentication.java deleted file mode 100644 index bc6f5cad5..000000000 --- a/src/main/java/org/openstack/model/identity/Authentication.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openstack.model.identity; - -public interface Authentication { - - Token getToken(); - - //void setToken(Token token); - - //void setPasswordCredentials(PasswordCredentials passwordCredentials); - - String getTenantId(); - - //void setTenantId(String tenantId); - - String getTenantName(); - - //void setTenantName(String tenantName); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/Credentials.java b/src/main/java/org/openstack/model/identity/Credentials.java deleted file mode 100644 index 913a67b8a..000000000 --- a/src/main/java/org/openstack/model/identity/Credentials.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.openstack.model.identity; - -public interface Credentials { - -} diff --git a/src/main/java/org/openstack/model/identity/Endpoint.java b/src/main/java/org/openstack/model/identity/Endpoint.java deleted file mode 100644 index f1157586e..000000000 --- a/src/main/java/org/openstack/model/identity/Endpoint.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openstack.model.identity; - -public interface Endpoint { - - String getId(); - - void setId(String id); - - String getRegion(); - - void setRegion(String region); - - String getServiceId(); - - void setServiceId(String serviceId); - - String getPublicURL(); - - void setPublicURL(String publicURL); - - String getAdminURL(); - - void setAdminURL(String adminURL); - - String getInternalURL(); - - void setInternalURL(String internalURL); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/EndpointList.java b/src/main/java/org/openstack/model/identity/EndpointList.java deleted file mode 100644 index edc58e604..000000000 --- a/src/main/java/org/openstack/model/identity/EndpointList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.identity; - -import java.util.List; - -public interface EndpointList { - - List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/Role.java b/src/main/java/org/openstack/model/identity/Role.java deleted file mode 100644 index 18e666c04..000000000 --- a/src/main/java/org/openstack/model/identity/Role.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openstack.model.identity; - -public interface Role { - - String getId(); - - void setId(String id); - - String getName(); - - void setName(String name); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/RoleList.java b/src/main/java/org/openstack/model/identity/RoleList.java deleted file mode 100644 index ffbff241b..000000000 --- a/src/main/java/org/openstack/model/identity/RoleList.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.openstack.model.identity; - -import java.util.List; - - -public interface RoleList { - - List getList(); - - //void setList(List list); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/Service.java b/src/main/java/org/openstack/model/identity/Service.java deleted file mode 100644 index 4c05841dd..000000000 --- a/src/main/java/org/openstack/model/identity/Service.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.model.identity; - -public interface Service { - - String getId(); - - void setId(String id); - - String getName(); - - void setName(String name); - - String getType(); - - void setType(String type); - - String getDescription(); - - void setDescription(String description); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/ServiceCatalogEntry.java b/src/main/java/org/openstack/model/identity/ServiceCatalogEntry.java deleted file mode 100644 index f94dae7a0..000000000 --- a/src/main/java/org/openstack/model/identity/ServiceCatalogEntry.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.openstack.model.identity; - -import java.util.List; - - -public interface ServiceCatalogEntry { - - String getName(); - - String getType(); - - List getEndpoints(); - - List getEndpointsLinks(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/ServiceEndpoint.java b/src/main/java/org/openstack/model/identity/ServiceEndpoint.java deleted file mode 100644 index 164d3b897..000000000 --- a/src/main/java/org/openstack/model/identity/ServiceEndpoint.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.openstack.model.identity; - -public interface ServiceEndpoint { - - String getRegion(); - - //void setRegion(String region); - - String getTenantId(); - - //void setTenantId(String tenantId); - - String getInternalURL(); - - //void setInternalURL(String internalURL); - - String getPublicURL(); - - //void setPublicURL(String publicURL); - - String getAdminURL(); - - //void setAdminURL(String adminURL); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/ServiceList.java b/src/main/java/org/openstack/model/identity/ServiceList.java deleted file mode 100644 index f2f65f84e..000000000 --- a/src/main/java/org/openstack/model/identity/ServiceList.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.openstack.model.identity; - -import java.util.List; - - -public interface ServiceList { - - List getList(); - - //void setList(List list); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/Tenant.java b/src/main/java/org/openstack/model/identity/Tenant.java deleted file mode 100644 index 8613eebc9..000000000 --- a/src/main/java/org/openstack/model/identity/Tenant.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.model.identity; - -public interface Tenant { - - String getId(); - - void setId(String id); - - String getName(); - - void setName(String name); - - boolean isEnabled(); - - void setEnabled(boolean enabled); - - String getDescription(); - - void setDescription(String description); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/TenantList.java b/src/main/java/org/openstack/model/identity/TenantList.java deleted file mode 100644 index 1ad4fa31a..000000000 --- a/src/main/java/org/openstack/model/identity/TenantList.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.openstack.model.identity; - -import java.util.List; - -import org.openstack.model.atom.Link; - -public interface TenantList { - - List getList(); - - //void setList(List list); - - List getLinks(); - - //void setLinks(List links); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/Token.java b/src/main/java/org/openstack/model/identity/Token.java deleted file mode 100644 index 6b5b18f43..000000000 --- a/src/main/java/org/openstack/model/identity/Token.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.openstack.model.identity; - -public interface Token { - - String getId(); - - //void setId(String id); - - String getExpires(); - - //void setExpires(String expires); - - Tenant getTenant(); - - //void setTenant(Tenant tenant); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/User.java b/src/main/java/org/openstack/model/identity/User.java deleted file mode 100644 index 23ec47a02..000000000 --- a/src/main/java/org/openstack/model/identity/User.java +++ /dev/null @@ -1,14 +0,0 @@ -package org.openstack.model.identity; - -import java.util.List; -import java.util.Map; - -public interface User extends UserForCreate { - - String getTenantId(); - - List getRoles(); - - Map getExtra(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/UserForCreate.java b/src/main/java/org/openstack/model/identity/UserForCreate.java deleted file mode 100644 index d02940d9b..000000000 --- a/src/main/java/org/openstack/model/identity/UserForCreate.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openstack.model.identity; - - -public interface UserForCreate { - - String getId(); - - void setId(String id); - - String getName(); - - void setName(String name); - - String getPassword(); - - void setPassword(String password); - - String getEmail(); - - void setEmail(String email); - - boolean isEnabled(); - - void setEnabled(boolean enabled); - - String getUsername(); - - void setUsername(String username); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/UserList.java b/src/main/java/org/openstack/model/identity/UserList.java deleted file mode 100644 index 7a22a35bf..000000000 --- a/src/main/java/org/openstack/model/identity/UserList.java +++ /dev/null @@ -1,12 +0,0 @@ -package org.openstack.model.identity; - -import java.util.List; - - -public interface UserList { - - List getList(); - - //void setList(List list); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneAccess.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneAccess.java deleted file mode 100644 index 9991b7815..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneAccess.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; -import java.util.NoSuchElementException; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.api.Namespaces; -import org.openstack.model.exceptions.OpenStackException; -import org.openstack.model.identity.Access; -import org.openstack.model.identity.ServiceCatalogEntry; -import org.openstack.model.identity.ServiceEndpoint; -import org.openstack.model.identity.Token; -import org.openstack.model.identity.User; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -@XmlType(namespace= Namespaces.NS_OPENSTACK_IDENTITY_2_0) -@XmlRootElement(name = "access") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("access") -public class KeystoneAccess implements Serializable, Access { - - @XmlElement(type = KeystoneToken.class) - private KeystoneToken token; - - @XmlElementWrapper(name = "serviceCatalog") - @XmlElement(name = "service", type = KeystoneService.class) - @JsonProperty("serviceCatalog") - @JsonDeserialize(as=List.class, contentAs=KeystoneServiceCatalogEntry.class) - private List services = new ArrayList(); - - @XmlElement(type = KeystoneUser.class) - private KeystoneUser user; - - /* (non-Javadoc) - * @see org.openstack.model.identity.glance.Access#getToken() - */ - @Override - public Token getToken() { - return token; - } - - public void setToken(KeystoneToken token) { - this.token = (KeystoneToken) token; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.glance.Access#getServices() - */ - @Override - - public List getServices() { - return services; - } - - public void setServices(List services) { - this.services = services; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.glance.Access#getUser() - */ - @Override - public User getUser() { - return user; - } - - public void setUser(KeystoneUser user) { - this.user = user; - } - - @Override - public String toString() { - return "KeyStoneAccess [token=" + token + ", services=" + services - + ", user=" + user + "]"; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.glance.Access#getEndpoint() - */ - @Override - public ServiceEndpoint getEndpoint(final String type, final String region) { - try { - ServiceCatalogEntry service = Iterables.find(getServices(), new Predicate() { - - @Override - public boolean apply(ServiceCatalogEntry service) { - return type.equals(service.getType()); - } - - }); - List endpoints = service.getEndpoints(); - if (region != null) { - return Iterables.find(endpoints, new Predicate() { - - @Override - public boolean apply(ServiceEndpoint endpoint) { - return region.equals(endpoint.getRegion()); - } - }); - } else { - return endpoints.get(0); - } - } catch (NoSuchElementException e) { - throw new OpenStackException("Service " + type + " not found, you can try openstack.target(, ) method instead"); - } catch (Exception e) { - throw new RuntimeException(e.getMessage(), e); - } - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneAccessKeyCredentials.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneAccessKeyCredentials.java deleted file mode 100644 index 0a0de79c8..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneAccessKeyCredentials.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAttribute; - -import org.openstack.model.identity.Credentials; - -public class KeystoneAccessKeyCredentials implements Credentials, Serializable { - - @XmlAttribute - private String accessKey; - - @XmlAttribute - private String secretKey; - - public String getAccessKey() { - return accessKey; - } - - public void setAccessKey(String accessKey) { - this.accessKey = accessKey; - } - - public String getSecretKey() { - return secretKey; - } - - public void setSecretKey(String secretKey) { - this.secretKey = secretKey; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneAccessKeyCredentialsAuthentication.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneAccessKeyCredentialsAuthentication.java deleted file mode 100644 index c6a38193b..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneAccessKeyCredentialsAuthentication.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.openstack.model.identity.keystone; - -import javax.xml.bind.annotation.XmlElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("auth") -public class KeystoneAccessKeyCredentialsAuthentication extends KeystoneAuthentication { - - @XmlElement(namespace= "", name="apiAccessKeyCredentials") - @JsonProperty - private KeystoneAccessKeyCredentials apiAccessKeyCredentials; - - public KeystoneAccessKeyCredentialsAuthentication(String accessKey, String secretKey) { - apiAccessKeyCredentials = new KeystoneAccessKeyCredentials(); - apiAccessKeyCredentials.setAccessKey(accessKey); - apiAccessKeyCredentials.setSecretKey(secretKey); - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneAuthentication.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneAuthentication.java deleted file mode 100644 index aaa8ceec9..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneAuthentication.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.api.Namespaces; -import org.openstack.model.identity.Authentication; -import org.openstack.model.identity.Token; - -@XmlType(namespace = Namespaces.NS_OPENSTACK_IDENTITY_2_0) -@XmlRootElement(name = "auth", namespace = "") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("auth") -public class KeystoneAuthentication implements Serializable, Authentication { - - @XmlElement(type = KeystoneToken.class) - private KeystoneToken token; - - @XmlAttribute - private String tenantId; - - @XmlAttribute - private String tenantName; - - protected KeystoneAuthentication() { - } - - public static KeystoneAuthentication withPasswordCredentials( - String username, String password) { - return new KeystonePasswordCredentialsAuthentication(username, password); - } - - public static KeystoneAuthentication withApiAccessKeyCredentials( - String accessKey, String secretKey) { - return new KeystoneAccessKeyCredentialsAuthentication(accessKey, - secretKey); - } - - public static KeystoneAuthentication withTokenAndTenant(String tokenId, String tenantId) { - KeystoneAuthentication auth = new KeystoneAuthentication(); - auth.token = new KeystoneToken(); - auth.token.setId(tokenId); - auth.tenantId = tenantId; - return auth; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.identity.glance.Authentication#getToken() - */ - @Override - public Token getToken() { - return token; - } - - public void setToken(KeystoneToken token) { - this.token = token; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.identity.glance.Authentication#getTenantId() - */ - @Override - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - /* - * (non-Javadoc) - * - * @see org.openstack.model.identity.glance.Authentication#getTenantName() - */ - @Override - public String getTenantName() { - return tenantName; - } - - public void setTenantName(String tenantName) { - this.tenantName = tenantName; - } - - @Override - public String toString() { - return "KeyStoneAuthentication [token=" + token + ", tenantId=" - + tenantId + ", tenantName=" + tenantName + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneEndpoint.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneEndpoint.java deleted file mode 100644 index 519d21abe..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneEndpoint.java +++ /dev/null @@ -1,117 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.identity.Endpoint; - -@JsonRootName("endpoint") -public class KeystoneEndpoint implements Endpoint, Serializable { - - private String id; - - private String region; - - @JsonProperty("service_id") - private String serviceId; - - @JsonProperty("publicurl") - private String publicURL; - - @JsonProperty("adminurl") - private String adminURL; - - @JsonProperty("internalurl") - private String internalURL; - - public KeystoneEndpoint() { - - } - - public KeystoneEndpoint(String id, String region, String serviceId) { - this.id = id; - this.region = region; - this.serviceId = serviceId; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Endpoint#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Endpoint#getRegion() - */ - @Override - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Endpoint#getServiceId() - */ - @Override - public String getServiceId() { - return serviceId; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Endpoint#getPublicURL() - */ - @Override - public String getPublicURL() { - return publicURL; - } - - public void setPublicURL(String publicURL) { - this.publicURL = publicURL; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Endpoint#getAdminURL() - */ - @Override - public String getAdminURL() { - return adminURL; - } - - public void setAdminURL(String adminURL) { - this.adminURL = adminURL; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Endpoint#getInternalURL() - */ - @Override - public String getInternalURL() { - return internalURL; - } - - public void setInternalURL(String internalURL) { - this.internalURL = internalURL; - } - - @Override - public String toString() { - return "KeystoneEndpoint [region=" + region + ", serviceId=" - + serviceId + ", publicURL=" + publicURL + ", adminURL=" - + adminURL + ", internalURL=" + internalURL + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneEndpointList.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneEndpointList.java deleted file mode 100644 index 864df35fd..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneEndpointList.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.identity.Endpoint; -import org.openstack.model.identity.EndpointList; - -public class KeystoneEndpointList implements EndpointList, Serializable { - - @JsonDeserialize(as=List.class, contentAs=KeystoneEndpoint.class) - private List endpoints = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.EndpointList#getList() - */ - @Override - public List getList() { - return endpoints; - } - - public void setList(List endpoints) { - this.endpoints = endpoints; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystonePasswordCredentials.java b/src/main/java/org/openstack/model/identity/keystone/KeystonePasswordCredentials.java deleted file mode 100644 index b8571cca2..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystonePasswordCredentials.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAttribute; - -import org.openstack.model.identity.Credentials; - -public class KeystonePasswordCredentials implements Credentials, Serializable { - - @XmlAttribute - private String username; - - @XmlAttribute - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystonePasswordCredentialsAuthentication.java b/src/main/java/org/openstack/model/identity/keystone/KeystonePasswordCredentialsAuthentication.java deleted file mode 100644 index b55f9df44..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystonePasswordCredentialsAuthentication.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.openstack.model.identity.keystone; - -import javax.xml.bind.annotation.XmlElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; - -@JsonRootName("auth") -public class KeystonePasswordCredentialsAuthentication extends KeystoneAuthentication { - - @XmlElement(namespace= "", name="passwordCredentials") - @JsonProperty - private KeystonePasswordCredentials passwordCredentials; - - public KeystonePasswordCredentialsAuthentication(String username, String password) { - passwordCredentials = new KeystonePasswordCredentials(); - passwordCredentials.setUsername(username); - passwordCredentials.setPassword(password); - } - - - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneRole.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneRole.java deleted file mode 100644 index 664e6a7b8..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneRole.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.identity.Role; - -@XmlRootElement(name="role") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("role") -public class KeystoneRole implements Serializable, Role { - - @XmlAttribute - private String id; - - @XmlAttribute - private String name; - - @XmlAttribute - private String serviceId; - - @XmlAttribute - private String tenantId; - - public KeystoneRole() { - - } - - public KeystoneRole(String id, String name) { - this.id = id; - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Role#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Role#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - //serviceId and tenantId are only in access/user/roles - - public String getServiceId() { - return serviceId; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - @Override - public String toString() { - return "Role [id=" + id + ", name=" + name + "]"; - } - -} - diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneRoleList.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneRoleList.java deleted file mode 100644 index 01ef24711..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneRoleList.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.identity.Role; -import org.openstack.model.identity.RoleList; - -@XmlRootElement(name="roles") -@XmlAccessorType(XmlAccessType.NONE) -public class KeystoneRoleList implements Serializable, RoleList { - - @XmlElement(name="role", type = KeystoneRole.class) - @JsonDeserialize(as=List.class, contentAs=KeystoneRole.class) - private List roles = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.RoleList#getList() - */ - @Override - public List getList() { - return roles; - } - - public void setList(List list) { - this.roles = list; - } - - @Override - public String toString() { - return "KeyStoneRoleList [roles=" + roles + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneService.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneService.java deleted file mode 100644 index ebe3716a0..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneService.java +++ /dev/null @@ -1,93 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.api.Namespaces; -import org.openstack.model.identity.Service; - -@XmlRootElement(name="service", namespace=Namespaces.NS_OPENSTACK_IDENTITY_ADM_1_0) -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("OS-KSADM:service") -public class KeystoneService implements Serializable, Service { - - @XmlAttribute - private String id; - - @XmlAttribute - private String name; - - @XmlAttribute - private String type; - - @XmlElement - private String description; - - public KeystoneService() { - - } - - public KeystoneService(String id, String name, String type, String description) { - this.id = id; - this.name = name; - this.type = type; - this.description = description; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Service#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Service#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Service#getType() - */ - @Override - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Service#getDescription() - */ - @Override - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceCatalogEntry.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceCatalogEntry.java deleted file mode 100644 index 9a8110544..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceCatalogEntry.java +++ /dev/null @@ -1,79 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; -import java.util.List; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.identity.ServiceCatalogEntry; -import org.openstack.model.identity.ServiceEndpoint; - -public class KeystoneServiceCatalogEntry implements Serializable, ServiceCatalogEntry { - - @XmlAttribute - private String name; - - @XmlAttribute - private String type; - - - @XmlElement(nillable = true, name = "endpoint", type = KeystoneServiceEndpoint.class) - @JsonProperty("endpoints") - @JsonDeserialize(as=List.class, contentAs=KeystoneServiceEndpoint.class) - private List endpoints; - - @JsonProperty("endpoints_links") - private List endpointsLinks; - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceCatalogEntry#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceCatalogEntry#getType() - */ - @Override - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceCatalogEntry#getEndpoints() - */ - @Override - public List getEndpoints() { - return (List) (List) endpoints; - } - - public void setEndpoints(List endpoints) { - this.endpoints = endpoints; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceCatalogEntry#getEndpointsLinks() - */ - @Override - public List getEndpointsLinks() { - return endpointsLinks; - } - - public void setEndpointsLinks(List endpointsLinks) { - this.endpointsLinks = endpointsLinks; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceEndpoint.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceEndpoint.java deleted file mode 100644 index f7d62787e..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceEndpoint.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; - -import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.openstack.model.identity.ServiceEndpoint; - -@XmlAccessorType(XmlAccessType.NONE) -@JsonIgnoreProperties({"publicURL2"}) -public class KeystoneServiceEndpoint implements Serializable, ServiceEndpoint { - - @XmlAttribute - private String region; - - @XmlAttribute - private String tenantId; - - @XmlAttribute - private String internalURL; - - @XmlAttribute - private String publicURL; - - @XmlAttribute - private String adminURL; - - @XmlAttribute - private String versionId; - - @XmlAttribute - private String versionInfo; - - @XmlAttribute - private String versionList; - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceEndpoint#getRegion() - */ - @Override - public String getRegion() { - return region; - } - - public void setRegion(String region) { - this.region = region; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceEndpoint#getTenantId() - */ - @Override - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceEndpoint#getInternalURL() - */ - @Override - public String getInternalURL() { - return internalURL; - } - - public void setInternalURL(String internalURL) { - this.internalURL = internalURL; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceEndpoint#getPublicURL() - */ - @Override - public String getPublicURL() { - return publicURL; - } - - public void setPublicURL(String publicURL) { - this.publicURL = publicURL; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceEndpoint#getAdminURL() - */ - @Override - public String getAdminURL() { - return adminURL; - } - - public void setAdminURL(String adminURL) { - this.adminURL = adminURL; - } - - public String getVersionId() { - return versionId; - } - - public void setVersionId(String versionId) { - this.versionId = versionId; - } - - public String getVersionInfo() { - return versionInfo; - } - - public void setVersionInfo(String versionInfo) { - this.versionInfo = versionInfo; - } - - public String getVersionList() { - return versionList; - } - - public void setVersionList(String versionList) { - this.versionList = versionList; - } - - @Override - public String toString() { - return "KeyStoneServiceEndpoint [region=" + region + ", tenantId=" - + tenantId + ", internalURL=" + internalURL + ", publicURL=" - + publicURL + ", adminURL=" + adminURL + ", versionId=" - + versionId + ", versionList=" + versionList + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceList.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceList.java deleted file mode 100644 index f303a7b04..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneServiceList.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.api.Namespaces; -import org.openstack.model.common.ListWithAtomLinks; -import org.openstack.model.identity.Service; -import org.openstack.model.identity.ServiceList; - -@XmlRootElement(name="services", namespace=Namespaces.NS_OPENSTACK_IDENTITY_ADM_1_0) -@XmlAccessorType(XmlAccessType.NONE) -public class KeystoneServiceList extends ListWithAtomLinks implements ServiceList { - - @XmlElement(name="service", namespace="http://docs.openstack.org/identity/api/ext/OS-KSADM/v1.0", type = KeystoneService.class) - @JsonProperty("OS-KSADM:services") - @JsonDeserialize(as=List.class, contentAs=KeystoneService.class) - private List list = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.ServiceList#getList() - */ - @Override - public List getList() { - return list; - } - - public void setList(List list) { - this.list = list; - } - - @Override - public String toString() { - return "KeyStoneServiceList [list=" + list + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneTenant.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneTenant.java deleted file mode 100644 index 0ca588079..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneTenant.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; -import java.util.Date; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.identity.Tenant; - -@XmlRootElement(name="tenant") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("tenant") -public class KeystoneTenant implements Serializable, Tenant { - - @XmlAttribute - private String id; - - @XmlAttribute - private String name; - - @XmlAttribute - private boolean enabled; - - @XmlAttribute - private Date created; - - @XmlAttribute - private Date updated; - - @XmlElement - private String description; - - public KeystoneTenant() { - super(); - // TODO Auto-generated constructor stub - } - - public KeystoneTenant(String id, String name) { - this.id = id; - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Tenant#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Tenant#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Tenant#isEnabled() - */ - @Override - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - public Date getUpdated() { - return updated; - } - - public void setUpdated(Date updated) { - this.updated = updated; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Tenant#getDescription() - */ - @Override - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @Override - public String toString() { - return "Tenant [id=" + id + ", name=" + name + ", enabled=" + enabled - + ", description=" + description + "]"; - } - -} - diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneTenantList.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneTenantList.java deleted file mode 100644 index 49d99ba2a..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneTenantList.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.atom.Link; -import org.openstack.model.identity.Tenant; -import org.openstack.model.identity.TenantList; - -@XmlRootElement(name = "tenants") -@XmlAccessorType(XmlAccessType.NONE) -public class KeystoneTenantList implements Serializable, TenantList { - - @XmlElement(name = "tenant", type = KeystoneTenant.class) - @JsonProperty("tenants") - @JsonDeserialize(as=List.class, contentAs=KeystoneTenant.class) - private List tenants; - - @JsonProperty("tenants_links") - private List links; - - public KeystoneTenantList() { - tenants = new ArrayList(); - } - - public KeystoneTenantList(Collection collection) { - this.tenants = new ArrayList(collection); - } - - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.TenantList#getList() - */ - @Override - public List getList() { - return tenants; - } - - - public void setList(List list) { - this.tenants = list; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.TenantList#getLinks() - */ - @Override - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - @Override - public String toString() { - return "KeyStoneTenantList [tenants=" + tenants + ", links=" + links + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneToken.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneToken.java deleted file mode 100644 index f55c99541..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneToken.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.identity.Tenant; -import org.openstack.model.identity.Token; - -@XmlAccessorType(XmlAccessType.NONE) -public class KeystoneToken implements Serializable, Token { - - @XmlAttribute - private String id; - - @XmlAttribute - private String expires; - - @XmlElement(type = KeystoneTenant.class) - @JsonDeserialize(as=KeystoneTenant.class) - private Tenant tenant; - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Token#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Token#getExpires() - */ - @Override - public String getExpires() { - return expires; - } - - public void setExpires(String expires) { - this.expires = expires; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.Token#getTenant() - */ - @Override - public Tenant getTenant() { - return tenant; - } - - public void setTenant(Tenant tenant) { - this.tenant = (KeystoneTenant) tenant; - } - - @Override - public String toString() { - return "KeyStoneToken [id=" + id + ", expires=" + expires + ", tenant=" - + tenant + "]"; - } - - -} - diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneUser.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneUser.java deleted file mode 100644 index 2e51b8e62..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneUser.java +++ /dev/null @@ -1,177 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; -import java.util.List; -import java.util.Map; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.identity.Role; -import org.openstack.model.identity.User; - -@XmlRootElement(name = "user") -@XmlAccessorType(XmlAccessType.NONE) -@JsonRootName("user") -public class KeystoneUser implements Serializable, User { - - @XmlAttribute - private String id; - - @XmlAttribute - private String name; - - @XmlAttribute - private String username; - - @XmlAttribute - private String password; - - @XmlAttribute - private String email; - - @XmlAttribute - private boolean enabled; - - @XmlAttribute - private String tenantId; - - @XmlElement(name = "roles") - @JsonDeserialize(as=List.class, contentAs=KeystoneRole.class) - private List roles; - - @JsonProperty("roles_links") - private List rolesLinks; - - @JsonProperty - private Map extra; - - public KeystoneUser() { - - } - - public KeystoneUser(String id, String name) { - this.id = id; - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.User#getId() - */ - @Override - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.User#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.User#getPassword() - */ - @Override - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.User#getEmail() - */ - @Override - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.User#isEnabled() - */ - @Override - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.User#getUsername() - */ - @Override - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getTenantId() { - return tenantId; - } - - public void setTenantId(String tenantId) { - this.tenantId = tenantId; - } - - public List getRolesLinks() { - return rolesLinks; - } - - public void setRolesLinks(List rolesLinks) { - this.rolesLinks = rolesLinks; - } - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.User#getRoles() - */ - @Override - public List getRoles() { - return roles; - } - - public void setRoles(List roles) { - this.roles = roles; - } - - public Map getExtra() { - return extra; - } - - public void setExtra(Map extra) { - this.extra = extra; - } - - @Override - public String toString() { - return "User [id=" + id + ", name=" + name + ", password=" + password + ", email=" + email + ", enabled=" + enabled + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/KeystoneUserList.java b/src/main/java/org/openstack/model/identity/keystone/KeystoneUserList.java deleted file mode 100644 index 59bdcdc07..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/KeystoneUserList.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.openstack.model.identity.keystone; - -import java.io.Serializable; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.identity.User; -import org.openstack.model.identity.UserList; - -@XmlRootElement(name = "users") -@XmlAccessorType(XmlAccessType.NONE) -public class KeystoneUserList implements Serializable, UserList { - - @XmlElement(name = "user", type = KeystoneUser.class) - @JsonDeserialize(as=List.class, contentAs=KeystoneUser.class) - private List users; - - /* (non-Javadoc) - * @see org.openstack.model.identity.keystone.UserList#getList() - */ - @Override - public List getList() { - return (List) (List) users; - } - - public void setList(List list) { - this.users = list; - } - - @Override - public String toString() { - return "KeyStoneUserList [users=" + users + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/identity/keystone/jaxb.index b/src/main/java/org/openstack/model/identity/keystone/jaxb.index deleted file mode 100644 index e57417d55..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/jaxb.index +++ /dev/null @@ -1,14 +0,0 @@ -KeystoneAccess -KeystoneAuthentication -KeystoneEndpointTemplates -KeystoneEndpointTemplatesList -KeystoneRole -KeystoneRoleList -KeystoneService -KeystoneServiceEndpoint -KeystoneServiceList -KeystoneTenant -KeystoneTenantList -KeystoneToken -KeystoneUser -KeystoneUserList diff --git a/src/main/java/org/openstack/model/identity/keystone/package-info.java b/src/main/java/org/openstack/model/identity/keystone/package-info.java deleted file mode 100644 index 1b7894630..000000000 --- a/src/main/java/org/openstack/model/identity/keystone/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -@javax.xml.bind.annotation.XmlSchema( - xmlns = { - @javax.xml.bind.annotation.XmlNs(prefix = "identity", namespaceURI = org.openstack.api.Namespaces.NS_OPENSTACK_IDENTITY_2_0), - @javax.xml.bind.annotation.XmlNs(prefix = "OS-KSADM", namespaceURI = org.openstack.api.Namespaces.NS_OPENSTACK_IDENTITY_ADM_1_0) - }, - namespace = org.openstack.api.Namespaces.NS_OPENSTACK_IDENTITY_2_0, - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package org.openstack.model.identity.keystone; - diff --git a/src/main/java/org/openstack/model/images/Image.java b/src/main/java/org/openstack/model/images/Image.java deleted file mode 100644 index 1ab36c514..000000000 --- a/src/main/java/org/openstack/model/images/Image.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.openstack.model.images; - -import java.util.Date; -import java.util.Map; - -public interface Image { - - public abstract String getUri(); - - public abstract void setUri(String uri); - - public abstract String getName(); - - public abstract void setName(String name); - - public abstract String getDiskFormat(); - - public abstract void setDiskFormat(String diskFormat); - - public abstract String getContainerFormat(); - - public abstract void setContainerFormat(String containerFormat); - - public abstract Long getSize(); - - public abstract void setSize(Long size); - - public abstract String getChecksum(); - - public abstract void setChecksum(String checksum); - - public abstract String getCreatedAt(); - - public abstract void setCreatedAt(String createdAt); - - public abstract String getUpdatedAt(); - - public abstract void setUpdatedAt(String updatedAt); - - public abstract Date getDeletedAt(); - - public abstract void setDeletedAt(Date deletedAt); - - public abstract String getStatus(); - - public abstract void setStatus(String status); - - public abstract Boolean isPublic(); - - public abstract void setPublic(Boolean isPublic); - - public abstract Integer getMinRam(); - - public abstract void setMinRam(Integer minRam); - - public abstract Integer getMinDisk(); - - public abstract void setMinDisk(Integer minDisk); - - public abstract String getOwner(); - - public abstract void setOwner(String owner); - - public abstract Boolean isDeleted(); - - public abstract void setDeleted(Boolean deleted); - - public abstract Boolean isProtected(); - - public abstract void setProtected(Boolean isProtected); - - public abstract String getId(); - - public abstract void setId(String id); - - public abstract Map getProperties(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/images/ImageList.java b/src/main/java/org/openstack/model/images/ImageList.java deleted file mode 100644 index 627012121..000000000 --- a/src/main/java/org/openstack/model/images/ImageList.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.images; - -import java.util.List; - -public interface ImageList extends Iterable { - - public abstract List getList(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/images/ImageUploadResponse.java b/src/main/java/org/openstack/model/images/ImageUploadResponse.java deleted file mode 100644 index b887e841f..000000000 --- a/src/main/java/org/openstack/model/images/ImageUploadResponse.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.openstack.model.images; - - -public interface ImageUploadResponse { - - public abstract Image getImage(); - - public abstract void setImage(Image image); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/images/glance/GlanceImage.java b/src/main/java/org/openstack/model/images/glance/GlanceImage.java deleted file mode 100644 index 12f6fb29b..000000000 --- a/src/main/java/org/openstack/model/images/glance/GlanceImage.java +++ /dev/null @@ -1,366 +0,0 @@ -package org.openstack.model.images.glance; - -import java.io.Serializable; -import java.util.Date; -import java.util.Map; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.codehaus.jackson.map.annotate.JsonRootName; -import org.openstack.model.images.Image; - -import com.google.common.collect.Maps; - -@JsonRootName("image") -public class GlanceImage implements Serializable, Image { - - - private String uri; - - @JsonProperty("name") - private String name; - - @JsonProperty("disk_format") - private String diskFormat; - - @JsonProperty("container_format") - private String containerFormat; - - @JsonProperty("size") - private Long size; - - @JsonProperty("checksum") - private String checksum; - - @JsonProperty("created_at") - private String createdAt; - - @JsonProperty("updated_at") - private String updatedAt; - - @JsonProperty("deleted_at") - private Date deletedAt; - - @JsonProperty("status") - private String status; - - @JsonProperty("is_public") - private Boolean isPublic; - - @JsonProperty("min_ram") - private Integer minRam; - - @JsonProperty("min_disk") - private Integer minDisk; - - @JsonProperty("owner") - private String owner; - - @JsonProperty("deleted") - private Boolean deleted; - - @JsonProperty("protected") - private Boolean isProtected; - - @JsonProperty("id") - private String id; - - final Map properties = Maps.newHashMap(); - - public GlanceImage() { - - } - - public GlanceImage(String id, String name) { - this.id = id; - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getUri() - */ - @Override - public String getUri() { - return uri; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setUri(java.lang.String) - */ - @Override - public void setUri(String uri) { - this.uri = uri; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getName() - */ - @Override - public String getName() { - return name; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setName(java.lang.String) - */ - @Override - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getDiskFormat() - */ - @Override - public String getDiskFormat() { - return diskFormat; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setDiskFormat(java.lang.String) - */ - @Override - public void setDiskFormat(String diskFormat) { - this.diskFormat = diskFormat; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getContainerFormat() - */ - @Override - public String getContainerFormat() { - return containerFormat; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setContainerFormat(java.lang.String) - */ - @Override - public void setContainerFormat(String containerFormat) { - this.containerFormat = containerFormat; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getSize() - */ - @Override - public Long getSize() { - return size; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setSize(java.lang.Long) - */ - @Override - public void setSize(Long size) { - this.size = size; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getChecksum() - */ - @Override - public String getChecksum() { - return checksum; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setChecksum(java.lang.String) - */ - @Override - public void setChecksum(String checksum) { - this.checksum = checksum; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getCreatedAt() - */ - @Override - public String getCreatedAt() { - return createdAt; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setCreatedAt(java.lang.String) - */ - @Override - public void setCreatedAt(String createdAt) { - this.createdAt = createdAt; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getUpdatedAt() - */ - @Override - public String getUpdatedAt() { - return updatedAt; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setUpdatedAt(java.lang.String) - */ - @Override - public void setUpdatedAt(String updatedAt) { - this.updatedAt = updatedAt; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getDeletedAt() - */ - @Override - public Date getDeletedAt() { - return deletedAt; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setDeletedAt(java.util.Date) - */ - @Override - public void setDeletedAt(Date deletedAt) { - this.deletedAt = deletedAt; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getStatus() - */ - @Override - public String getStatus() { - return status; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setStatus(java.lang.String) - */ - @Override - public void setStatus(String status) { - this.status = status; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#isPublic() - */ - @Override - public Boolean isPublic() { - return isPublic; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setPublic(java.lang.Boolean) - */ - @Override - public void setPublic(Boolean isPublic) { - this.isPublic = isPublic; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getMinRam() - */ - @Override - public Integer getMinRam() { - return minRam; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setMinRam(java.lang.Integer) - */ - @Override - public void setMinRam(Integer minRam) { - this.minRam = minRam; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getMinDisk() - */ - @Override - public Integer getMinDisk() { - return minDisk; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setMinDisk(java.lang.Integer) - */ - @Override - public void setMinDisk(Integer minDisk) { - this.minDisk = minDisk; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getOwner() - */ - @Override - public String getOwner() { - return owner; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setOwner(java.lang.String) - */ - @Override - public void setOwner(String owner) { - this.owner = owner; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#isDeleted() - */ - @Override - public Boolean isDeleted() { - return deleted; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setDeleted(java.lang.Boolean) - */ - @Override - public void setDeleted(Boolean deleted) { - this.deleted = deleted; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#isProtected() - */ - @Override - public Boolean isProtected() { - return isProtected; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setProtected(java.lang.Boolean) - */ - @Override - public void setProtected(Boolean isProtected) { - this.isProtected = isProtected; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getId() - */ - @Override - public String getId() { - return id; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#setId(java.lang.String) - */ - @Override - public void setId(String id) { - this.id = id; - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.Image#getProperties() - */ - @Override - public Map getProperties() { - return properties; - } - - @Override - public String toString() { - return "Image [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 + ", deleted=" + deleted + ", isProtected=" + isProtected + ", id=" + id + ", properties=" + properties + "]"; - } - - -} diff --git a/src/main/java/org/openstack/model/images/glance/GlanceImageList.java b/src/main/java/org/openstack/model/images/glance/GlanceImageList.java deleted file mode 100644 index dac5f9289..000000000 --- a/src/main/java/org/openstack/model/images/glance/GlanceImageList.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openstack.model.images.glance; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.images.Image; -import org.openstack.model.images.ImageList; - -public class GlanceImageList implements Serializable, ImageList { - - @JsonDeserialize(as=List.class, contentAs=GlanceImage.class) - private List images = new ArrayList(); - - public GlanceImageList() { - - } - - public GlanceImageList(Collection collection) { - this.images = new ArrayList(collection); - } - - /* (non-Javadoc) - * @see org.openstack.model.image.glance.ImageList#getList() - */ - @Override - public List getList() { - return images; - } - - @Override - public String toString() { - return "GlanceImageList [images=" + images + "]"; - } - - @Override - public Iterator iterator() { - return getList().iterator(); - } - -} diff --git a/src/main/java/org/openstack/model/storage/StorageAccount.java b/src/main/java/org/openstack/model/storage/StorageAccount.java deleted file mode 100644 index dcdd15d41..000000000 --- a/src/main/java/org/openstack/model/storage/StorageAccount.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.model.storage; - -import java.util.List; - -public interface StorageAccount { - - List getContainers(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/storage/StorageContainer.java b/src/main/java/org/openstack/model/storage/StorageContainer.java deleted file mode 100644 index 9059124f9..000000000 --- a/src/main/java/org/openstack/model/storage/StorageContainer.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.openstack.model.storage; - -import java.util.List; - -public interface StorageContainer { - - String getName(); - - long getCount(); - - long getBytes(); - - List getObjects(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/storage/StorageObject.java b/src/main/java/org/openstack/model/storage/StorageObject.java deleted file mode 100644 index 0554a8836..000000000 --- a/src/main/java/org/openstack/model/storage/StorageObject.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.openstack.model.storage; - -import java.util.Date; - -public interface StorageObject { - - String getName(); - - String getHash(); - - Long getBytes(); - - String getContentType(); - - Date getLastModified(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/storage/StorageObjectProperties.java b/src/main/java/org/openstack/model/storage/StorageObjectProperties.java deleted file mode 100644 index 2f08a74ae..000000000 --- a/src/main/java/org/openstack/model/storage/StorageObjectProperties.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.openstack.model.storage; - -import java.util.Date; -import java.util.Map; - -public interface StorageObjectProperties { - - String getName(); - - Map getCustomProperties(); - - Date getDate(); - - Date getLastModified(); - - Long getContentLength(); - - String getETag(); - - String getContentType(); - - Date getLastModifiedDate(); - -} \ No newline at end of file diff --git a/src/main/java/org/openstack/model/storage/swift/SwiftAccount.java b/src/main/java/org/openstack/model/storage/swift/SwiftAccount.java deleted file mode 100644 index f8b9f112a..000000000 --- a/src/main/java/org/openstack/model/storage/swift/SwiftAccount.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.openstack.model.storage.swift; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.map.annotate.JsonDeserialize; -import org.openstack.model.storage.StorageAccount; -import org.openstack.model.storage.StorageContainer; - -@XmlRootElement(name = "account") -@XmlAccessorType(XmlAccessType.NONE) -public class SwiftAccount implements StorageAccount { - - @XmlElement(name="container") - @JsonDeserialize(as=List.class, contentAs=SwiftContainer.class) - private List containers = new ArrayList(); - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.Account#getContainers() - */ - @Override - public List getContainers() { - return containers; - } - - @Override - public String toString() { - return "SwiftAccount [containers=" + containers + "]"; - } - - -} diff --git a/src/main/java/org/openstack/model/storage/swift/SwiftContainer.java b/src/main/java/org/openstack/model/storage/swift/SwiftContainer.java deleted file mode 100644 index 5f0fa0090..000000000 --- a/src/main/java/org/openstack/model/storage/swift/SwiftContainer.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.openstack.model.storage.swift; - -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.openstack.model.storage.StorageContainer; -import org.openstack.model.storage.StorageObject; - -import com.google.common.collect.Lists; - -@XmlRootElement(name = "container") -@XmlAccessorType(XmlAccessType.NONE) -public class SwiftContainer implements StorageContainer { - - @XmlElement - private String name; - - @XmlElement - private long count; - - @XmlElement - private long bytes; - - @XmlElement(name = "object") - private List objects; - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.Container#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.Container#getCount() - */ - @Override - public long getCount() { - return count; - } - - public void setCount(long count) { - this.count = count; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.Container#getBytes() - */ - @Override - public long getBytes() { - return bytes; - } - - public void setBytes(long bytes) { - this.bytes = bytes; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.Container#getObjects() - */ - @Override - public List getObjects() { - if (objects == null) - objects = Lists.newArrayList(); - return (List) (List) objects; - } - - @Override - public String toString() { - return "Container [name=" + name + ", count=" + count + ", bytes=" + bytes + ", objects=" + objects + "]"; - } - -} diff --git a/src/main/java/org/openstack/model/storage/swift/SwiftStorageObject.java b/src/main/java/org/openstack/model/storage/swift/SwiftStorageObject.java deleted file mode 100644 index 4f9a9d90c..000000000 --- a/src/main/java/org/openstack/model/storage/swift/SwiftStorageObject.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.openstack.model.storage.swift; - -import java.util.Date; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.openstack.model.storage.StorageObject; - -@XmlRootElement(name = "object") -@XmlAccessorType(XmlAccessType.NONE) -public class SwiftStorageObject implements StorageObject { - @XmlElement - private String name; - @XmlElement - private String hash; - - @XmlElement - private Long bytes; - - @XmlElement(name="content_type") - @JsonProperty("content_type") - private String contentType; - - @XmlElement(name = "last_modified") - @JsonProperty("last_modified") - private Date lastModified; - - private String subdir; - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObject#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObject#getHash() - */ - @Override - public String getHash() { - return hash; - } - - public void setHash(String hash) { - this.hash = hash; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObject#getBytes() - */ - @Override - public Long getBytes() { - return bytes; - } - - public void setBytes(Long bytes) { - this.bytes = bytes; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObject#getContentType() - */ - @Override - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObject#getLastModified() - */ - @Override - public Date getLastModified() { - return lastModified; - } - - public void setLastModified(Date lastModified) { - this.lastModified = lastModified; - } - - public String getSubdir() { - return subdir; - } - - public void setSubdir(String subdir) { - this.subdir = subdir; - } - -} diff --git a/src/main/java/org/openstack/model/storage/swift/SwiftStorageObjectProperties.java b/src/main/java/org/openstack/model/storage/swift/SwiftStorageObjectProperties.java deleted file mode 100644 index 07a0e1889..000000000 --- a/src/main/java/org/openstack/model/storage/swift/SwiftStorageObjectProperties.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openstack.model.storage.swift; - -import java.util.Date; -import java.util.Map; - -import org.codehaus.jackson.annotate.JsonProperty; -import org.openstack.model.storage.StorageObjectProperties; - -import com.google.common.collect.Maps; - -public class SwiftStorageObjectProperties implements StorageObjectProperties { - private String name; - - private Date date; - - @JsonProperty("last-modified") - private Date lastModified; - - @JsonProperty("content-length") - private Long contentLength; - - @JsonProperty("etag") - private String eTag; - - @JsonProperty("content-type") - private String contentType; - - private Map customProperties; - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObjectProperties#getName() - */ - @Override - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObjectProperties#getCustomProperties() - */ - @Override - public Map getCustomProperties() { - if (customProperties == null) { - customProperties = Maps.newHashMap(); - } - return customProperties; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObjectProperties#getDate() - */ - @Override - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObjectProperties#getLastModified() - */ - @Override - public Date getLastModified() { - return lastModified; - } - - public void setLastModified(Date lastModified) { - this.lastModified = lastModified; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObjectProperties#getContentLength() - */ - @Override - public Long getContentLength() { - return contentLength; - } - - public void setContentLength(Long contentLength) { - this.contentLength = contentLength; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObjectProperties#getETag() - */ - @Override - public String getETag() { - return eTag; - } - - public void setETag(String eTag) { - this.eTag = eTag; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObjectProperties#getContentType() - */ - @Override - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } - - public void setCustomProperties(Map customProperties) { - this.customProperties = customProperties; - } - - @Override - public String toString() { - return "ObjectProperties [name=" + name + ", date=" + date + ", lastModified=" + lastModified - + ", contentLength=" + contentLength + ", etag=" + eTag + ", contentType=" + contentType - + ", customProperties=" + customProperties + "]"; - } - - /* (non-Javadoc) - * @see org.openstack.model.storage.swift.StorageObjectProperties#getLastModifiedDate() - */ - @Override - public Date getLastModifiedDate() { - return lastModified; - } - -} diff --git a/src/test/java/org/openstack/client/AbstractOpenStackTest.java b/src/test/java/org/openstack/client/AbstractOpenStackTest.java deleted file mode 100644 index 13775a297..000000000 --- a/src/test/java/org/openstack/client/AbstractOpenStackTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.openstack.client; - -import java.io.FileInputStream; -import java.io.IOException; -import java.util.Properties; - -import org.openstack.client.utils.RandomUtil; -import org.openstack.model.exceptions.OpenStackException; -import org.testng.SkipException; - -public abstract class AbstractOpenStackTest { - - protected OpenStackClient client; - - protected boolean verbose; - - protected boolean glanceEnabled; - protected boolean swiftEnabled; - - protected String format; - - protected RandomUtil random = new RandomUtil(); - - public void init(String configuration) { - - try { - Properties properties = new Properties(); - properties.load(new FileInputStream(configuration)); - - glanceEnabled = Boolean.parseBoolean(properties.getProperty("test.glance")); - swiftEnabled = Boolean.parseBoolean(properties.getProperty("test.swift")); - - // Command line properties should take precedence - properties.putAll(System.getProperties()); - - client = OpenStackClient.authenticate(properties); - } catch (IOException e) { - throw new OpenStackException(e.getMessage()); - } - - } - - protected void skipUntilBugFixed(int bugNumber) { - throw new SkipException("Skipping because of bug #" + bugNumber); - } - -} diff --git a/src/test/java/org/openstack/client/Test.java b/src/test/java/org/openstack/client/Test.java deleted file mode 100644 index 8a2207537..000000000 --- a/src/test/java/org/openstack/client/Test.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.openstack.client; - -import java.util.Properties; - -import org.openstack.api.identity.IdentityAdministrationEndpoint; -import org.openstack.model.identity.ServiceList; - -public class Test { - - public static void main(String[] args) throws Exception { - - Properties properties = new Properties(); - - //properties.setProperty("auth.endpoint", "http://192.168.1.52:5000/v2.0"); - //properties.setProperty("auth.username", "admin"); - //properties.setProperty("auth.password", "secret0"); - - //properties.setProperty("identity.default.endpoint.adminURL","http://192.168.1.52:35357/v2.0"); - //The admintoken (setted on keystone config file) - //properties.setProperty("identity.admin.token", "secret0"); - - properties.setProperty("identity.endpoint.publicURL", "https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/"); - properties.setProperty("auth.credentials", "apiAccessKeyCredentials"); - properties.setProperty("auth.accessKey", ""); - properties.setProperty("auth.secretKey", ""); - properties.setProperty("auth.tenantId", ""); - properties.setProperty("verbose", "true"); - - OpenStackClient openstack = OpenStackClient.authenticate(properties); - - //IdentityAdministrationEndpoint identity = openstack.getIdentityAdministationEndpoint(); - -// TenantList tenants = identity.tenants().get(); -// -// KeystoneTenant kst = new KeystoneTenant(); -// kst.setName("test"); -// kst.setDescription("desc"); -// kst.setEnabled(true); -// Tenant tenant = identity.tenants().post(kst); -// -// tenant = identity.tenants().tenant(tenant.getId()).get(); -// -// identity.tenants().tenant(tenant.getId()).delete(); -// -// 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(); -// -// RoleList roles = identity.roles().get(); -// -// KeystoneRole ksr = new KeystoneRole(); -// ksr.setName("test"); -// Role role = identity.roles().post(ksr); -// -// role = identity.roles().role(role.getId()).get(); -// -// identity.roles().role(role.getId()).delete(); -// -// ServiceList services = identity.services().get(); - -// KeystoneService kss = new KeystoneService(); -// kss.setName("test"); -// kss.setType("compute"); -// kss.setDescription("Nova 3"); -// Service service = identity.services().post(kss); -// -// Service service = identity.services().service(services.getList().get(0).getId()).get(); - - - - - -// identity.endpoints().get(); - -// KeystoneEndpoint kse = new KeystoneEndpoint(); -// -// -// kse.setRegion("RegionOne"); -// kse.setServiceId(service.getId()); -// kse.setPublicURL("http://192.168.1.52:8774/v2/$(tenant_id)s"); -// kse.setInternalURL("http://192.168.1.52:8774/v2/$(tenant_id)s"); -// kse.setAdminURL("http://192.168.1.52:8774/v2/$(tenant_id)s"); -// -// Endpoint endpoint = identity.endpoints().post(kse); - -// identity.endpoints().endpoint(endpoint.getId()).delete(); - -// identity.services().service(service.getId()).delete(); -// -// openstack = openstack.reauthenticateOnTenant("admin"); -// -// -// TenantResource compute = openstack.getComputeEndpoint(); -// -// ServerList servers = compute.servers().get(); -// -// ImageList images = compute.images().get(); -// // "cirros-0.3.0-x86_64-blank" -// -// FlavorList flavors = compute.flavors().get(); -// -// KeyPairList keypairs = compute.keyPairs().get(); -// -// SecurityGroupList securityGroups = compute.securityGroups().get(); -// -// VolumeList volumes = compute.volumes().get(); -// -// org.openstack.model.images.ImageList gImages = openstack.getImagesEndpoint().get(); -// -// List sAccount = openstack.getStorageEndpoint().get(); -// -// SwiftStorageObjectProperties p = new SwiftStorageObjectProperties(); -// openstack.getStorageEndpoint().container(sAccount.get(0).getName()).object("test2").put(new File("logging.properties"), p); - - } - -} diff --git a/src/test/java/org/openstack/client/compute/AggregatesIT.java b/src/test/java/org/openstack/client/compute/AggregatesIT.java deleted file mode 100644 index d834ed769..000000000 --- a/src/test/java/org/openstack/client/compute/AggregatesIT.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.openstack.client.compute; - -import java.util.HashMap; -import java.util.Map; - -import org.openstack.model.compute.nova.aggregate.AggregateActions; -import org.openstack.model.compute.nova.aggregate.AggregateForCreate; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class AggregatesIT extends ComputeIntegrationTest { - - @BeforeClass - public void init() { - init("etc/openstack.admin.properties"); - compute = client.getComputeEndpoint(); - } - - @Test - public void create() { - AggregateForCreate aggregate = new AggregateForCreate(); - aggregate.setName("aggregate.1"); - aggregate.setAvailabilityZone("nova"); - compute.aggregates().post(aggregate); - } - - @Test - public void setMetadata() { - //actually adds metadata - Map data = new HashMap(); - data.put("k1", "v1"); - data.put("k2", "v2"); - compute.aggregates().aggregate("1").post(AggregateActions.setMetadata(data)); - } - - @Test - public void addHost() { - compute.aggregates().aggregate("1").post(AggregateActions.addHost("openstack")); - } - - @Test - public void removeHost() { - //InvalidAggregateAction: Cannot perform action 'remove host' on aggregate 1. Reason: setup in progress. - compute.aggregates().aggregate("1").post(AggregateActions.removeHost("openstack")); - } - - @Test - public void show() { - compute.aggregates().aggregate("1").get(); - } - - @Test - public void list() { - compute.aggregates().get(); - } - - @Test - public void delete() { - compute.aggregates().aggregate("1").delete(); - } - -} diff --git a/src/test/java/org/openstack/client/compute/CloudPipeIT.java b/src/test/java/org/openstack/client/compute/CloudPipeIT.java deleted file mode 100644 index 7451765ca..000000000 --- a/src/test/java/org/openstack/client/compute/CloudPipeIT.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.openstack.client.compute; - -import org.openstack.model.compute.nova.cloudpipe.NovaCloudPipeForCreate; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class CloudPipeIT extends ComputeIntegrationTest { - - @BeforeClass - public void init() { - init("etc/openstack.admin.properties"); - compute = client.getComputeEndpoint(); - } - - @Test - public void create() { - NovaCloudPipeForCreate request = new NovaCloudPipeForCreate(); - request.setProjectId("a38ad80666164604b4537224a07aea7e"); - compute.cloudPipe().post(request); - } - - @Test - public void list() { - compute.cloudPipe().get(); - } - -} diff --git a/src/test/java/org/openstack/client/compute/ComputeIntegrationTest.java b/src/test/java/org/openstack/client/compute/ComputeIntegrationTest.java deleted file mode 100644 index e8ff5f50f..000000000 --- a/src/test/java/org/openstack/client/compute/ComputeIntegrationTest.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openstack.client.compute; - -import java.util.List; - -import org.openstack.api.compute.TenantResource; -import org.openstack.client.AbstractOpenStackTest; -import org.openstack.model.common.Extension; -import org.openstack.model.compute.Flavor; -import org.openstack.model.compute.Image; -import org.testng.SkipException; -import org.testng.annotations.BeforeClass; - -public abstract class ComputeIntegrationTest extends AbstractOpenStackTest { - - protected TenantResource compute; - - @BeforeClass - public void init() { - System.out.println("Without admin"); - init("etc/openstack.public.properties"); - compute = client.getComputeEndpoint(); - } - - protected Flavor findSmallestFlavor() { - Flavor bestFlavor = null; - for (Flavor flavor : compute.flavors().get().getList()) { - if (bestFlavor == null || bestFlavor.getRam() > flavor.getRam()) { - bestFlavor = flavor; - } - } - return bestFlavor; - } - - protected Image findUecImage() { - for (Image i : compute.images().get().getList()) { - // Some UEC images - if (i.getName().equals("lucid-server-cloudimg-amd64") || i.getName().equals("natty-server-cloudimg-amd64")) { - return i; - } - } - return null; - } - - - - protected Image getUecImage() { - Image image = findUecImage(); - if (image == null) { - throw new SkipException("Skipping test because image not found"); - } - - System.out.println("Using image: " + image); - - return image; - } - - protected void skipIfNoSecurityGroups() { - if (!supportsSecurityGroups()) - throw new SkipException("Security group support not found"); - } - - protected void skipIfNoKeyPairs() { - if (!supportsPublicKeys()) { - throw new SkipException("KeyPair support not found"); - } - } - - public boolean supportsPublicKeys() { - return supportsExtension("http://docs.openstack.org/ext/keypairs/api/v1.1") || supportsExtension("http://docs.openstack.org/compute/ext/keypairs/api/v1.1"); - } - - public boolean supportsSecurityGroups() { - return supportsExtension("http://docs.openstack.org/ext/securitygroups/api/v1.1") || supportsExtension("http://docs.openstack.org/compute/ext/securitygroups/api/v1.1"); - } - - List extensions; - - private boolean supportsExtension(String namespace) { - if (extensions == null) { - extensions = compute.extensions().get().getList(); - } - for (Extension extension : extensions) { - if (namespace.equals(extension.getNamespace())) - return true; - } - return false; - } - -} diff --git a/src/test/java/org/openstack/client/compute/ConfigDriveIT.java b/src/test/java/org/openstack/client/compute/ConfigDriveIT.java deleted file mode 100644 index 0b3b2e9aa..000000000 --- a/src/test/java/org/openstack/client/compute/ConfigDriveIT.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.openstack.client.compute; - -import org.openstack.model.compute.Flavor; -import org.openstack.model.compute.Image; -import org.openstack.model.compute.KeyPair; -import org.openstack.model.compute.Server; -import org.openstack.model.compute.nova.NovaServerForCreate; -import org.openstack.model.compute.nova.keypair.NovaKeyPair; -import org.testng.SkipException; -import org.testng.annotations.Test; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -public class ConfigDriveIT extends ComputeIntegrationTest { - - @Test - public void testCreateAndDeleteServer() throws Exception { - - - //Image image = getUecImage(); - //NovaImage image = findImageByName("DebianSqueeze_20120226"); - Image image = Iterables.find(compute.images().get().getList(), new Predicate() { - - @Override - public boolean apply(Image image) { - return "cirros-0.3.0-x86_64-uec".equals(image.getName()); - } - }); - if (image == null) { - throw new SkipException("Cannot find image for test"); - } - Flavor bestFlavor = findSmallestFlavor(); - - NovaServerForCreate serverForCreate = new NovaServerForCreate(); - serverForCreate.setName(random.randomAlphanumericString(10)); - serverForCreate.setFlavorRef(bestFlavor.getId()); - serverForCreate.setImageRef(image.getId()); - - // TODO: We may require iso9660 - /* - File homeDir = new File(System.getProperty("user.home")); - File publicKeyFile = new File(homeDir, ".ssh" + File.separator + "id_rsa.pub"); - String publicKey = FileUtils.readFileToString(publicKeyFile); - publicKey = publicKey.replace("\r", ""); - publicKey = publicKey.replace("\n", ""); - publicKey = publicKey.replace("\t", " "); - - String keyName = random.randomAlphanumericString(10); - - NovaKeyPair keyPair = new NovaKeyPair(); - keyPair.setPublicKey(publicKey); - keyPair.setName(keyName); - - - compute.keyPairs().post(new HashMap(), Entity.json(keyPair)); - */ - KeyPair keyPair = compute.keyPairs().post(new NovaKeyPair(random.randomAlphanumericString(5))); - - serverForCreate.setKeyName(keyPair.getName()); - serverForCreate.setConfigDrive(true); - - Server server = compute.servers().post(serverForCreate); - - // Wait for the server to be ready - // AsyncServerOperation async = AsyncServerOperation.wrapServerCreate(client.compute(), server); - // NovaServer ready = async.get(); - - // Assert.assertEquals("ACTIVE", ready.getStatus()); - - // Delete the server - System.out.println("Deleting server: " + server); - compute.servers().server(server.getId()).delete(); - compute.keyPairs().keypair("test").delete(); - } - -} diff --git a/src/test/java/org/openstack/client/compute/ExtensionsIT.java b/src/test/java/org/openstack/client/compute/ExtensionsIT.java deleted file mode 100644 index 6d809c299..000000000 --- a/src/test/java/org/openstack/client/compute/ExtensionsIT.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.openstack.client.compute; - -import org.openstack.model.common.Extension; -import org.openstack.model.common.ExtensionList; -import org.openstack.model.exceptions.OpenStackException; -import org.testng.Assert; -import org.testng.annotations.Test; - -public class ExtensionsIT extends ComputeIntegrationTest { - - @Test - public void testListExtensions() throws OpenStackException { - - ExtensionList extensions = compute.extensions().get(); - for (Extension extension : extensions) { - Extension details = compute.extensions().extension(extension.getAlias()).get(); - - Assert.assertEquals(details.getAlias(), extension.getAlias()); - Assert.assertEquals(details.getDescription(), extension.getDescription()); - Assert.assertEquals(details.getName(), extension.getName()); - Assert.assertEquals(details.getNamespace(), extension.getNamespace()); - Assert.assertEquals(details.getUpdated(), extension.getUpdated()); - } - } -} diff --git a/src/test/java/org/openstack/client/compute/FloatingIpDnsIT.java b/src/test/java/org/openstack/client/compute/FloatingIpDnsIT.java deleted file mode 100644 index eaea56414..000000000 --- a/src/test/java/org/openstack/client/compute/FloatingIpDnsIT.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.openstack.client.compute; - -import org.openstack.model.compute.nova.floatingipdns.DnsEntry; -import org.openstack.model.compute.nova.floatingipdns.DomainEntry; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class FloatingIpDnsIT extends ComputeIntegrationTest { - - @BeforeClass - public void init() { - init("etc/openstack.admin.properties"); - compute = client.getComputeEndpoint(); - } - - @Test - public void listDomains() { - compute.floatingIpDns().get(); - } - - public void listByIp() { - compute.floatingIpDns().domain("").entries().get("10.2.3.4"); - } - - public void listByName() { - compute.floatingIpDns().domain("").entries().entry("").get(); - } - - @Test - public void createPrivateDomain() { - DomainEntry entry = new DomainEntry(); - entry.setAvailabilityZone("nova"); - entry.setScope("private"); - compute.floatingIpDns().domain("woorea").put(entry); - } - - //@Test error maybe project - public void createPublicDomain() { - DomainEntry entry = new DomainEntry(); - entry.setScope("public"); - entry.setProject("demo"); - compute.floatingIpDns().domain("woorea2").put(entry); - } - - @Test - public void deleteDomain() { - compute.floatingIpDns().domain("woorea").delete(); - } - - @Test - public void createDnsEntry() { - DnsEntry entry = new DnsEntry(); - entry.setIp("10.0.0.1"); - entry.setDnsType("A"); - compute.floatingIpDns().domain("woorea").entries().entry("fake").put(entry); - } - - @Test - public void updateDnsEntry() { - DnsEntry entry = new DnsEntry(); - entry.setIp("10.0.0.2"); - entry.setDnsType("B"); - compute.floatingIpDns().domain("woorea").entries().entry("fake").put(entry); - } - - @Test - public void deleteDnsEntry() { - compute.floatingIpDns().domain("woorea").entries().entry("fake").delete(); - } - -} diff --git a/src/test/java/org/openstack/client/compute/FloatingIpPoolsIT.java b/src/test/java/org/openstack/client/compute/FloatingIpPoolsIT.java deleted file mode 100644 index f847632e7..000000000 --- a/src/test/java/org/openstack/client/compute/FloatingIpPoolsIT.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openstack.client.compute; - -public class FloatingIpPoolsIT extends ComputeIntegrationTest { - - public void list() { - compute.floatingIpPools().get(); - } - -} diff --git a/src/test/java/org/openstack/client/compute/FloatingIpsIT.java b/src/test/java/org/openstack/client/compute/FloatingIpsIT.java deleted file mode 100644 index 14d2b802d..000000000 --- a/src/test/java/org/openstack/client/compute/FloatingIpsIT.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.openstack.client.compute; - -import org.openstack.model.compute.FloatingIp; -import org.openstack.model.compute.FloatingIpList; -import org.testng.annotations.Test; - -public class FloatingIpsIT extends ComputeIntegrationTest { - - private FloatingIp floatingIp; - - @Test - public void listFloatingIps() { - FloatingIpList ips = compute.floatingIps().get(); - } - - @Test - public void createFloatingIp() throws Exception { - - floatingIp = compute.floatingIps().post(null); - - } - - @Test(dependsOnMethods="createFloatingIp", priority=1000) - public void deleteFloatingIp() { - compute.floatingIps().floatingIp(floatingIp.getId()).delete(); - } - -} diff --git a/src/test/java/org/openstack/client/compute/HostsIT.java b/src/test/java/org/openstack/client/compute/HostsIT.java deleted file mode 100644 index f836a2040..000000000 --- a/src/test/java/org/openstack/client/compute/HostsIT.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openstack.client.compute; - -import org.openstack.api.compute.ext.HostResource.HostAction; -import org.openstack.model.compute.nova.host.UpdateNovaHostRequest; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class HostsIT extends ComputeIntegrationTest { - - @BeforeClass - public void init() { - init("etc/openstack.admin.properties"); - compute = client.getComputeEndpoint(); - } - - @Test - public void list() { - compute.hosts().get(); - } - - @Test - public void show() { - System.out.println(compute.hosts().host("openstack").get()); - } - - @Test - public void enableHost() { - UpdateNovaHostRequest request = new UpdateNovaHostRequest(); - request.setStatus("enable"); - compute.hosts().host("openstack").put(request); - } - - @Test - public void disableHost() { - UpdateNovaHostRequest request = new UpdateNovaHostRequest(); - request.setStatus("disable"); - compute.hosts().host("openstack").put(request); - } - - @Test - public void enableMaintenance() { - UpdateNovaHostRequest request = new UpdateNovaHostRequest(); - request.setMaintenanceMode("enable"); - compute.hosts().host("openstack").put(request); - } - - @Test - public void disableMaintenance() { - UpdateNovaHostRequest request = new UpdateNovaHostRequest(); - request.setMaintenanceMode("disable"); - compute.hosts().host("openstack").put(request); - } - - @Test - public void startup() { - compute.hosts().host("openstack").get(HostAction.STARTUP); - } - - @Test - public void shutdown() { - compute.hosts().host("openstack").get(HostAction.SHUTDOWN); - } - - @Test - public void reboot() { - compute.hosts().host("openstack").get(HostAction.REBOOT); - } - -} diff --git a/src/test/java/org/openstack/client/compute/KeyPairsIT.java b/src/test/java/org/openstack/client/compute/KeyPairsIT.java deleted file mode 100644 index 3a1988b5e..000000000 --- a/src/test/java/org/openstack/client/compute/KeyPairsIT.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openstack.client.compute; - -import org.openstack.api.compute.TenantResource; -import org.openstack.model.compute.KeyPair; -import org.openstack.model.compute.KeyPairListItem; -import org.openstack.model.compute.nova.keypair.NovaKeyPair; -import org.openstack.model.exceptions.OpenStackException; -import org.testng.Assert; -import org.testng.annotations.Test; - -public class KeyPairsIT extends ComputeIntegrationTest { - - @Test - public void testListKeypairs() throws OpenStackException { - skipIfNoKeyPairs(); - - for (KeyPairListItem keyPairItem : compute.keyPairs().get().getList()) { - KeyPair keyPair = keyPairItem.getKeypair(); - Assert.assertNotNull(keyPair.getName()); - Assert.assertNotNull(keyPair.getFingerprint()); - Assert.assertNotNull(keyPair.getPublicKey()); - } - } - - @Test - public void deleteAllKeypairs() throws OpenStackException { - - for (KeyPairListItem keyPair : compute.keyPairs().get().getList()) { - try { - compute.keyPairs().keypair(keyPair.getKeypair().getName()).delete(); - } catch (Exception e) { - - } - } - } - - private void assertKeyPairEquals(KeyPair actual, KeyPair expected) { - Assert.assertEquals(actual.getName(), expected.getName()); - Assert.assertEquals(actual.getFingerprint(), expected.getFingerprint()); - Assert.assertEquals(actual.getPublicKey(), expected.getPublicKey()); - } - - private void testCreateAndDelete(String name) { - - NovaKeyPair createRequest = new NovaKeyPair(); - createRequest.setName(name); - - KeyPair created = compute.keyPairs().post(createRequest); - Assert.assertEquals(created.getName(), name); - Assert.assertNotNull(created.getPublicKey()); - Assert.assertNotNull(created.getFingerprint()); - - KeyPair fetched = findKeyPair(compute, created.getName()); - assertKeyPairEquals(fetched, created); - - // Delete the keypair - compute.keyPairs().keypair(created.getName()).delete(); - - fetched = findKeyPair(compute, created.getName()); - - Assert.assertNull(fetched); - } - - @Test - public void testCreateAndDelete() throws OpenStackException { - skipIfNoKeyPairs(); - - // OSAPI-BUG: I think an full-ascii name is often undeletable - // String name = random.randomAsciiString(1, 10).trim(); - String name = random.randomAlphanumericString(1, 12).trim(); - - testCreateAndDelete(name); - } - - private KeyPair findKeyPair(TenantResource nova, String name) { - for (KeyPairListItem keyPair : nova.keyPairs().get().getList()) { - if (keyPair.getKeypair().getName().equals(name)) - return keyPair.getKeypair(); - } - return null; - } - -} diff --git a/src/test/java/org/openstack/client/compute/NetworksIT.java b/src/test/java/org/openstack/client/compute/NetworksIT.java deleted file mode 100644 index 4efb5d70d..000000000 --- a/src/test/java/org/openstack/client/compute/NetworksIT.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.openstack.client.compute; - -import org.testng.annotations.Test; - -public class NetworksIT extends ComputeIntegrationTest { - - @Test - public void list() { - compute.networks().get(); - } - - @Test - public void show() { - compute.networks().network("465254a5-7393-4e1b-8a88-7d635b40ae00").get(); - } - - @Test - public void delete() { - compute.networks().network("465254a5-7393-4e1b-8a88-7d635b40ae00").delete(); - } - -} diff --git a/src/test/java/org/openstack/client/compute/QuotasIT.java b/src/test/java/org/openstack/client/compute/QuotasIT.java deleted file mode 100644 index 50ec17e92..000000000 --- a/src/test/java/org/openstack/client/compute/QuotasIT.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.openstack.client.compute; - -import org.openstack.model.compute.nova.quota.NovaQuotaSet; - -public class QuotasIT extends ComputeIntegrationTest { - - public void show() { - compute.quotas("").get(); - } - - public void update() { - NovaQuotaSet quotas = new NovaQuotaSet(); - compute.quotas("").put(quotas); - } - -} diff --git a/src/test/java/org/openstack/client/compute/RescueIT.java b/src/test/java/org/openstack/client/compute/RescueIT.java deleted file mode 100644 index 33ad8994e..000000000 --- a/src/test/java/org/openstack/client/compute/RescueIT.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.openstack.client.compute; - -public class RescueIT extends ComputeIntegrationTest { - -} diff --git a/src/test/java/org/openstack/client/compute/SecurityGroupsIT.java b/src/test/java/org/openstack/client/compute/SecurityGroupsIT.java deleted file mode 100644 index 0438d5fc8..000000000 --- a/src/test/java/org/openstack/client/compute/SecurityGroupsIT.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.openstack.client.compute; - -import javax.ws.rs.client.InvocationException; - -import org.openstack.model.compute.SecurityGroup; -import org.openstack.model.compute.SecurityGroupForCreate; -import org.openstack.model.compute.SecurityGroupRule; -import org.openstack.model.compute.SecurityGroupRuleForCreate; -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroupForCreate; -import org.openstack.model.compute.nova.securitygroup.NovaSecurityGroupRuleForCreate; -import org.openstack.model.exceptions.OpenStackException; -import org.testng.Assert; -import org.testng.annotations.Test; - -public class SecurityGroupsIT extends ComputeIntegrationTest { - - @Test - public void testListSecurityGroups() throws OpenStackException { - skipIfNoSecurityGroups(); - - for (SecurityGroup securityGroup : compute.securityGroups().get().getList()) { - SecurityGroup details = compute.securityGroups().securityGroup(securityGroup.getId()).get(); - - assertSecurityGroupEquals(securityGroup, details); - } - } - - @Test - public void testCreateAndDelete() throws OpenStackException { - skipIfNoSecurityGroups(); - - - - String groupName = random.randomAlphanumericString(1, 128).trim(); - String description = random.randomAlphanumericString(1, 255).trim(); - - SecurityGroupForCreate createRequest = new NovaSecurityGroupForCreate(); - createRequest.setName(groupName); - createRequest.setDescription(description); - - SecurityGroup created = compute.securityGroups().post(createRequest); - Assert.assertEquals(created.getName(), groupName); - Assert.assertEquals(created.getDescription(), description); - Assert.assertNotNull(created.getId()); - Assert.assertNotEquals(created.getId(), 0); - - SecurityGroup fetched = compute.securityGroups().securityGroup(created.getId()).get(); - assertSecurityGroupEquals(fetched, created); - - Assert.assertEquals(fetched.getRules().size(), 0); - - // Create a rule - { - NovaSecurityGroupRuleForCreate newRule = new NovaSecurityGroupRuleForCreate(); - newRule.setCidr("1.2.3.4/32"); - newRule.setFromPort(1234); - newRule.setToPort(5678); - newRule.setIpProtocol("tcp"); - newRule.setParentGroupId(created.getId()); - //newRule.setGroupId(created.getId()); - - SecurityGroupRule createdRule = compute.securityGroupRules().post(newRule); - Assert.assertNotNull(createdRule.getId()); - - fetched = compute.securityGroups().securityGroup(created.getId()).get(); - assertSecurityGroupEquals(fetched, created); - - Assert.assertEquals(fetched.getRules().size(), 1); - SecurityGroupRule rule = fetched.getRules().get(0); - assertSecurityGroupRuleEquals(newRule, rule); - - // List the rules directly - { - //NovaSecurityGroupRule found = client.compute().publicEndpoint().securityGroupRules().securityGroupRule(createdRule.id).get(); - //assertSecurityGroupRuleEquals(newRule, found); - } - } - - // Drop the rule - { - SecurityGroupRule rule = fetched.getRules().get(0); - compute.securityGroupRules().rule(rule.getId()).delete(); - - fetched = compute.securityGroups().securityGroup(created.getId()).get(); - Assert.assertEquals(fetched.getRules().size(), 0); - } - - compute.securityGroups().securityGroup(created.getId()).delete(); - - fetched = null; - try { - fetched = compute.securityGroups().securityGroup(created.getId()).get(); - } catch (InvocationException e) { - // Expected; leave fetched as null - } - - Assert.assertNull(fetched); - } - - private void assertSecurityGroupEquals(SecurityGroup actual, SecurityGroup expected) { - Assert.assertEquals(actual.getId(), expected.getId()); - Assert.assertEquals(actual.getTenantId(), expected.getTenantId()); - Assert.assertEquals(actual.getName(), expected.getName()); - Assert.assertEquals(actual.getDescription(), expected.getDescription()); - } - - private void assertSecurityGroupRuleEquals(SecurityGroupRuleForCreate newRule, SecurityGroupRule rule) { - Assert.assertEquals(rule.getFromPort(), newRule.getFromPort()); - Assert.assertEquals(rule.getToPort(), newRule.getToPort()); - Assert.assertEquals(rule.getIpProtocol(), newRule.getIpProtocol()); - Assert.assertEquals(rule.getIpRange().getCidr(), newRule.getCidr()); - } - -} diff --git a/src/test/java/org/openstack/client/compute/ServersIT.java b/src/test/java/org/openstack/client/compute/ServersIT.java deleted file mode 100644 index 6798807b9..000000000 --- a/src/test/java/org/openstack/client/compute/ServersIT.java +++ /dev/null @@ -1,113 +0,0 @@ -package org.openstack.client.compute; - -import java.util.NoSuchElementException; -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.openstack.model.compute.Flavor; -import org.openstack.model.compute.Image; -import org.openstack.model.compute.Server; -import org.openstack.model.compute.ServerList; -import org.openstack.model.compute.nova.NovaServerForCreate; -import org.openstack.model.compute.nova.server.actions.PauseAction; -import org.openstack.model.compute.nova.server.actions.UnpauseAction; -import org.testng.SkipException; -import org.testng.annotations.Test; - -import com.google.common.base.Predicate; -import com.google.common.collect.Iterables; - -public class ServersIT extends ComputeIntegrationTest { - - private Server server; - - @Test - public void listServers() { - - ServerList servers = compute.servers().get(); - - for (Server server : servers.getList()) { - //Until this is resolved? on compute server api we access throught id - //NovaImage image = client.target(server.getImage().getLink("bookmark").getHref(), ImageResource.class).get(new HashMap()); - Image image = compute.images().image(server.getImage().getId()).get(); - //rel=self carries the version but rel=bookmark ¿clarify from openstack team? - //client.target(server.getLink("self").getHref(), ServerResource.class).delete(); - } - } - - - @Test - public void createServer() throws Exception { - - try { - Flavor bestFlavor = null; - for (Flavor flavor : compute.flavors().get().getList()) { - if (bestFlavor == null || bestFlavor.getRam() > flavor.getRam()) { - bestFlavor = flavor; - } - } - - Image image = Iterables.find(compute.images().get().getList(), new Predicate() { - - @Override - public boolean apply(Image image) { - return "cirros-0.3.0-x86_64-uec".equals(image.getName()); - } - }); - - NovaServerForCreate serverForCreate = new NovaServerForCreate(); - serverForCreate.setName(random.randomAlphanumericString(10)); - serverForCreate.setFlavorRef(findSmallestFlavor().getId()); - serverForCreate.setImageRef(image.getId()); - // serverForCreate.setSecurityGroups(new ArrayList() {{ - // add(new ServerForCreate.SecurityGroup("test")); - // }}); - - - server = compute.servers().post(serverForCreate); - waitForState("ACTIVE"); - } catch (NoSuchElementException e) { - throw new SkipException("Skipping test because image not found"); - } - - } - - @Test(dependsOnMethods="createServer", priority=1) - public void pauseServer() throws Exception { - compute.servers().server(server.getId()).action().post(new PauseAction(), String.class); - waitForState("PAUSED"); - } - - @Test(dependsOnMethods={"createServer"}, priority=2) - public void unpauseServer() { - compute.servers().server(server.getId()).action().post(new UnpauseAction(), String.class); - } - - @Test(dependsOnMethods="createServer", priority=1000) - public void deleteServer() { - compute.servers().server(server.getId()).delete(); - } - - private void waitForState(final String state) { - try { - final ScheduledThreadPoolExecutor timer = new ScheduledThreadPoolExecutor(1); - timer.scheduleAtFixedRate(new Runnable() { - - @Override - public void run() { - server = compute.servers().server(server.getId()).get(); - if(state.equals(server.getStatus())) { - timer.shutdown(); - } else { - System.out.print("."); - } - } - }, 10, 5, TimeUnit.SECONDS); - timer.awaitTermination(30, TimeUnit.SECONDS); - } catch (Exception e) { - - } - - } - -} diff --git a/src/test/java/org/openstack/client/compute/SimpleTenantUsageIT.java b/src/test/java/org/openstack/client/compute/SimpleTenantUsageIT.java deleted file mode 100644 index 8c8a2a471..000000000 --- a/src/test/java/org/openstack/client/compute/SimpleTenantUsageIT.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.openstack.client.compute; - -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class SimpleTenantUsageIT extends ComputeIntegrationTest { - - @BeforeClass - public void init() { - init("etc/openstack.admin.properties"); - compute = client.getComputeEndpoint(); - } - - @Test - public void list() { - compute.usages().get(null, null); - } - - @Test - public void show() { - compute.usages().tenant("a38ad80666164604b4537224a07aea7e").get(null, null); - } - -} diff --git a/src/test/java/org/openstack/client/compute/VolumesIT.java b/src/test/java/org/openstack/client/compute/VolumesIT.java deleted file mode 100644 index a1ade7d6c..000000000 --- a/src/test/java/org/openstack/client/compute/VolumesIT.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.openstack.client.compute; - -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.openstack.model.compute.Snapshot; -import org.openstack.model.compute.SnapshotList; -import org.openstack.model.compute.Volume; -import org.openstack.model.compute.VolumeList; -import org.openstack.model.compute.nova.snapshot.NovaSnapshotForCreate; -import org.openstack.model.compute.nova.volume.NovaVolumeAttachment; -import org.openstack.model.compute.nova.volume.NovaVolumeForCreate; -import org.testng.Assert; -import org.testng.annotations.Test; - -public class VolumesIT extends ComputeIntegrationTest { - - private Volume volume; - private Snapshot snapshot; - - @Test(priority=1) - public void cleanAll() { - VolumeList volumes = compute.volumes().get(); - for(Volume v : volumes.getList()) { - compute.volumes().volume(v.getId()).delete(); - } - SnapshotList snapshots = compute.snapshots().get(); - for(Snapshot s : snapshots.getList()) { - compute.snapshots().snapshot(s.getId()).delete(); - } - } - - @Test(priority=2) - public void createVolume() throws Exception { - NovaVolumeForCreate nv = new NovaVolumeForCreate(); - nv.setName("v2"); - nv.setSizeInGB(1); - volume = compute.volumes().post(nv); - System.out.println(volume); - waitForState("available"); - } - - @Test(dependsOnMethods="createVolume", priority=1) - public void listVolumes() { - VolumeList volumes = compute.volumes().get(); - Assert.assertNotNull(volumes); - } - - @Test(dependsOnMethods="createVolume", priority=2) - public void showVolume() throws Exception { - volume = compute.volumes().volume(volume.getId()).get(); - System.out.println(volume); - } - - @Test(dependsOnMethods={"createVolume","deleteSnapshot"}, priority=1000, alwaysRun=true) - public void deleteVolume() { - compute.volumes().volume(volume.getId()).delete(); - } - - public void createVolumeAttachment() { - NovaVolumeAttachment attachment = new NovaVolumeAttachment(); - attachment.setVolumeId(volume.getId()); - attachment.setDevice("/mnt"); - compute.servers().server("").attachments().post(attachment); - } - - public void deleteVolumeAttachment() { - compute.servers().server("").attachments().attachment(volume.getId()).delete(); - } - - private void waitForState(final String state) { - try { - final ScheduledThreadPoolExecutor timer = new ScheduledThreadPoolExecutor(1); - timer.scheduleAtFixedRate(new Runnable() { - - @Override - public void run() { - volume = compute.volumes().volume(volume.getId()).get(); - if(state.equals(volume.getStatus()) || "error".equals(volume.getStatus())) { - timer.shutdown(); - } else { - System.out.print("."); - } - } - }, 3, 1, TimeUnit.SECONDS); - timer.awaitTermination(30, TimeUnit.SECONDS); - } catch (Exception e) { - - } - - } - - @Test(dependsOnMethods={"createVolume"}) - public void createSnapshot() throws Exception { - NovaSnapshotForCreate ns = new NovaSnapshotForCreate(); - ns.setVolumeId(volume.getId()); - ns.setName("v2"); - ns.setDescription("desc"); - snapshot = compute.snapshots().post(ns); - waitForState(snapshot, "available"); - } - - @Test(dependsOnMethods={"createSnapshot"}) - public void listSnapshots() { - SnapshotList snapshots = compute.snapshots().get(); - Assert.assertNotNull(snapshots); - } - - - - @Test(dependsOnMethods="createSnapshot", priority=1) - public void showSnapshot() throws Exception { - snapshot = compute.snapshots().snapshot(snapshot.getId()).get(); - System.out.println(snapshot); - } - - @Test(dependsOnMethods="createSnapshot", priority=1000) - public void deleteSnapshot() { - compute.snapshots().snapshot(snapshot.getId()).delete(); - } - - private void waitForState(final Snapshot snapshot, final String state) { - try { - final ScheduledThreadPoolExecutor timer = new ScheduledThreadPoolExecutor(1); - timer.scheduleAtFixedRate(new Runnable() { - - @Override - public void run() { - Snapshot check = compute.snapshots().snapshot(snapshot.getId()).get(); - if(state.equals(check.getStatus()) || "error".equals(check.getStatus())) { - timer.shutdown(); - } else { - System.out.print("."); - } - } - }, 3, 1, TimeUnit.SECONDS); - timer.awaitTermination(30, TimeUnit.SECONDS); - } catch (Exception e) { - - } - - } - -} diff --git a/src/test/java/org/openstack/client/identity/KeystoneAdministrationTest.java b/src/test/java/org/openstack/client/identity/KeystoneAdministrationTest.java deleted file mode 100644 index ec497eb05..000000000 --- a/src/test/java/org/openstack/client/identity/KeystoneAdministrationTest.java +++ /dev/null @@ -1,210 +0,0 @@ -package org.openstack.client.identity; - -import javax.ws.rs.core.Response; - -import org.openstack.api.identity.IdentityAdministrationEndpoint; -import org.openstack.client.AbstractOpenStackTest; -import org.openstack.model.identity.Endpoint; -import org.openstack.model.identity.EndpointList; -import org.openstack.model.identity.Role; -import org.openstack.model.identity.RoleList; -import org.openstack.model.identity.Service; -import org.openstack.model.identity.ServiceList; -import org.openstack.model.identity.Tenant; -import org.openstack.model.identity.TenantList; -import org.openstack.model.identity.User; -import org.openstack.model.identity.UserList; -import org.openstack.model.identity.keystone.KeystoneEndpoint; -import org.openstack.model.identity.keystone.KeystoneRole; -import org.openstack.model.identity.keystone.KeystoneService; -import org.openstack.model.identity.keystone.KeystoneTenant; -import org.openstack.model.identity.keystone.KeystoneUser; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -@Test -public class KeystoneAdministrationTest extends AbstractOpenStackTest { - - private IdentityAdministrationEndpoint identity; - - private Tenant tenant; - private User user; - private Role role; - private Service service; - private Endpoint endpoint; - - @BeforeClass - public void init() { - init("etc/openstack.admin.properties"); - identity = client.getIdentityAdministationEndpoint(); - } - - @Test(priority = 1) - public void createTenant() { - KeystoneTenant kst = new KeystoneTenant(); - kst.setName("test"); - kst.setDescription("desc"); - kst.setEnabled(true); - tenant = identity.tenants().post(kst); - Assert.assertNotNull(tenant); - } - - @Test(priority = 2) - public void createUser() { - KeystoneUser ksu = new KeystoneUser(); - ksu.setName("test2"); - ksu.setPassword("secret0"); - ksu.setEmail("test@test.com"); - ksu.setEnabled(true); - user = identity.users().post(ksu); - Assert.assertNotNull(user); - } - - @Test(priority = 3) - public void createRole() { - KeystoneRole ksr = new KeystoneRole(); - role = identity.roles().post(ksr); - Assert.assertNotNull(role); - } - - @Test(priority = 5) - public void createService() { - KeystoneService kss = new KeystoneService(); - kss.setName("test"); - kss.setType("compute"); - kss.setDescription("Nova 3"); - service = identity.services().post(kss); - Assert.assertNotNull(service); - } - - @Test(priority = 6) - public void createEndpoint() { - try { - KeystoneEndpoint kse = new KeystoneEndpoint(); - - kse.setRegion("RegionOne"); - kse.setServiceId(service.getId()); - kse.setPublicURL("http://192.168.1.52:8774/v2/$(tenant_id)s"); - kse.setInternalURL("http://192.168.1.52:8774/v2/$(tenant_id)s"); - kse.setAdminURL("http://192.168.1.52:8774/v2/$(tenant_id)s"); - - endpoint = identity.endpoints().post(kse); - Assert.assertNotNull(endpoint); - } catch (Exception e) { - // TODO: maybe TemplatedCatalog? - } - } - - public void listTenants() { - TenantList tenants = identity.tenants().get(); - Assert.assertNotNull(tenants); - } - - @Test(dependsOnMethods = { "createTenant" }) - public void listTenantUsers() { - UserList users = identity.tenants().tenant(tenant.getId()).users() - .get(); - Assert.assertNotNull(users); - } - - @Test(dependsOnMethods = { "createTenant" }, priority = 500) - public void deleteTenant() { - Response response = identity.tenants().tenant(tenant.getId()).delete(); - Assert.assertNotNull(response); - } - - public void listUsers() { - UserList users = identity.users().get(); - Assert.assertNotNull(users); - } - - @Test(dependsOnMethods = { "createUser" }) - public void updateUser() { - KeystoneUser ksu = (KeystoneUser) user; - ksu.setEmail("luis@woorea.es"); - user = identity.users().user(user.getId()).put(ksu); - Assert.assertNotNull(user); - } - - @Test(dependsOnMethods = { "createUser" }) - public void updateUserPassword() { - KeystoneUser ksu = (KeystoneUser) user; - ksu.setPassword("testing"); - identity.users().user(user.getId()).password(user); - Assert.assertNotNull(user); - } - - @Test(dependsOnMethods = { "createUser" }) - public void updateUserTenant() { - // identity.users().user(user.getId()).password(user); - // Assert.assertNotNull(user); - } - - @Test(dependsOnMethods = { "createUser" }) - public void updateUserEnabled() { - KeystoneUser ksu = (KeystoneUser) user; - ksu.setEnabled(false); - identity.users().user(user.getId()).enabled(user); - Assert.assertNotNull(user); - } - - @Test(dependsOnMethods = { "createUser" }, priority = 400) - public void deleteUser() { - Response response = identity.users().user(user.getId()).delete(); - Assert.assertNotNull(response); - } - - @Test(dependsOnMethods = { "createService" }) - public void showService() { - service = identity.services().service(service.getId()).get(); - Assert.assertNotNull(service); - } - - public void listServices() { - ServiceList services = identity.services().get(); - Assert.assertNotNull(services); - } - - @Test(dependsOnMethods = { "createService" }, priority = 200) - public void deleteService() { - Response response = identity.services().service("").delete(); - Assert.assertNotNull(response); - } - - public void listEndpoints() { - try { - EndpointList endpoints = identity.endpoints().get(); - Assert.assertNotNull(endpoints); - } catch (Exception e) { - // TODO: maybe TemplatedCatalog? - } - } - - @Test(dependsOnMethods = { "createEndpoint" }, priority = 100) - public void deleteEndpoint() { - try { - Response response = identity.endpoints().endpoint(endpoint.getId()).delete(); - Assert.assertNotNull(response); - } catch (Exception e) { - // TODO: maybe TemplatedCatalog? - } - } - - @Test(dependsOnMethods = { "createRole" }) - public void showRole() { - role = identity.roles().role(role.getId()).get(); - Assert.assertNotNull(role); - } - - public void listRoles() { - RoleList roles = identity.roles().get(); - Assert.assertNotNull(roles); - } - - @Test(dependsOnMethods = { "createRole" }, priority = 300) - public void deleteRole() { - Response response = identity.roles().role("").delete(); - Assert.assertNotNull(response); - } -} diff --git a/src/test/java/org/openstack/client/identity/KeystonePublicTest.java b/src/test/java/org/openstack/client/identity/KeystonePublicTest.java deleted file mode 100644 index 22169815f..000000000 --- a/src/test/java/org/openstack/client/identity/KeystonePublicTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.openstack.client.identity; - -import org.openstack.api.identity.IdentityPublicEndpoint; -import org.openstack.client.AbstractOpenStackTest; -import org.openstack.model.identity.TenantList; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -@Test -public class KeystonePublicTest extends AbstractOpenStackTest { - - private IdentityPublicEndpoint identity; - - @BeforeClass - public void init() { - init("etc/openstack.public.properties"); - identity = client.getIdentityEndpoint(); - } - - public void listTenants() { - TenantList tenants = identity.tenants().get(); - Assert.assertNotNull(tenants); - } - -} \ No newline at end of file diff --git a/src/test/java/org/openstack/client/identity/UserRoleOnTenantTest.java b/src/test/java/org/openstack/client/identity/UserRoleOnTenantTest.java deleted file mode 100644 index f2b272441..000000000 --- a/src/test/java/org/openstack/client/identity/UserRoleOnTenantTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.openstack.client.identity; - -import org.openstack.api.identity.IdentityAdministrationEndpoint; -import org.openstack.client.AbstractOpenStackTest; -import org.openstack.model.identity.Role; -import org.openstack.model.identity.Tenant; -import org.openstack.model.identity.User; -import org.openstack.model.identity.keystone.KeystoneRole; -import org.openstack.model.identity.keystone.KeystoneTenant; -import org.openstack.model.identity.keystone.KeystoneUser; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class UserRoleOnTenantTest extends AbstractOpenStackTest { - - private IdentityAdministrationEndpoint identity; - - private Tenant tenant; - private User user; - private Role role; - - @BeforeClass - public void init() { - init("etc/openstack.admin.properties"); - identity = client.getIdentityAdministationEndpoint(); - } - - @Test - public void addRoleToUserOnTenant() { - KeystoneTenant kst = new KeystoneTenant(); - kst.setName("test5"); - kst.setDescription("desc"); - kst.setEnabled(true); - tenant = identity.tenants().post(kst); - - KeystoneUser ksu = new KeystoneUser(); - ksu.setName("test5"); - ksu.setPassword("secret0"); - ksu.setEmail("test@test.com"); - ksu.setEnabled(true); - user = identity.users().post(ksu); - - KeystoneRole ksr = new KeystoneRole(); - ksr.setName("test5"); - role = identity.roles().post(ksr); - - role = identity.tenants().tenant(tenant.getId()).users().user(user.getId()).roles().role(role.getId()).put(); - Assert.assertNotNull(role); - } - - @Test(dependsOnMethods={"addRoleToUserOnTenant"}) - public void deleteRoleFromUserOnTenant() { - identity.tenants().tenant(tenant.getId()).users().user(user.getId()).roles().role(role.getId()).delete(); - identity.roles().role(role.getId()).delete(); - identity.users().user(user.getId()).delete(); - identity.tenants().tenant(tenant.getId()).delete(); - } - -} diff --git a/src/test/java/org/openstack/client/images/GlanceIntegrationTest.java b/src/test/java/org/openstack/client/images/GlanceIntegrationTest.java deleted file mode 100644 index 4a4a1c334..000000000 --- a/src/test/java/org/openstack/client/images/GlanceIntegrationTest.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.openstack.client.images; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertNull; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; - -import org.openstack.api.images.ImagesResource; -import org.openstack.client.AbstractOpenStackTest; -import org.openstack.model.images.Image; -import org.openstack.model.images.ImageList; -import org.openstack.model.images.glance.GlanceImage; -import org.testng.Assert; -import org.testng.SkipException; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class GlanceIntegrationTest extends AbstractOpenStackTest { - - private ImagesResource images; - - private Image uploaded; - - @BeforeClass - public void init() { - if (!glanceEnabled) { - init("etc/openstack.public.properties"); - images = client.getImagesEndpoint(); - } else { - throw new SkipException("Skipping because glance not present / accessible"); - } - - } - - @Test - public void createImage() { - try { - Image image = new GlanceImage(); - image.setName(random.randomAlphanumericString(1, 16).trim()); - image.setDiskFormat("raw"); - image.setContainerFormat("bare"); - - int size = 1024; - InputStream is = new ByteArrayInputStream(new byte[size]); - - uploaded = images.post(is, size, image); - assertEquals(uploaded.getSize(), Long.valueOf(size)); - assertEquals(uploaded.getName(), image.getName()); - assertNull(uploaded.getDeletedAt()); - assertNotNull(uploaded.getCreatedAt()); - assertNotNull(uploaded.getUpdatedAt()); - assertNotNull(uploaded.getId()); - assertEquals(uploaded.isDeleted(), Boolean.FALSE); - assertEquals(uploaded.getDiskFormat(), image.getDiskFormat()); - assertEquals(uploaded.getContainerFormat(), image.getContainerFormat()); - assertNotNull(uploaded.getOwner()); - assertEquals(uploaded.getStatus(), "active"); - } catch(Exception e) { - throw new RuntimeException(e.getMessage(), e); - } - } - - @Test(priority=1) - public void listImages() { - ImageList list = images.get(); - Assert.assertNotNull(list); - } - - - @Test(dependsOnMethods="createImage", priority=2) - public void showImage() { - Image image = images.image(uploaded.getId()).head(); - assertImageEquals(image, uploaded); - } - - public void updateImage() { - - } - - @Test(dependsOnMethods="createImage", priority=3) - public void deleteImage() { - images.image(uploaded.getId()).delete(); - } - - private void assertImageEquals(Image actual, Image expected) { - assertEquals(actual.getId(), expected.getId()); - assertEquals(actual.getChecksum(), expected.getChecksum()); - assertEquals(actual.getContainerFormat(), expected.getContainerFormat()); - assertEquals(actual.getCreatedAt(), expected.getCreatedAt()); - assertEquals(actual.getDeletedAt(), expected.getDeletedAt()); - assertEquals(actual.getDiskFormat(), expected.getDiskFormat()); - assertEquals(actual.getMinDisk(), expected.getMinDisk()); - assertEquals(actual.getMinRam(), expected.getMinRam()); - assertEquals(actual.getName(), expected.getName()); - assertEquals(actual.getOwner(), expected.getOwner()); - assertEquals(actual.getSize(), expected.getSize()); - assertEquals(actual.getStatus(), expected.getStatus()); - assertEquals(actual.getProperties(), expected.getProperties()); - } - -} diff --git a/src/test/java/org/openstack/client/storage/StorageIT.java b/src/test/java/org/openstack/client/storage/StorageIT.java deleted file mode 100644 index ea7d32b4e..000000000 --- a/src/test/java/org/openstack/client/storage/StorageIT.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openstack.client.storage; - -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.util.List; - -import javax.ws.rs.core.Response; - -import org.openstack.api.storage.AccountResource; -import org.openstack.client.AbstractOpenStackTest; -import org.openstack.model.storage.StorageContainer; -import org.openstack.model.storage.swift.SwiftStorageObjectProperties; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class StorageIT extends AbstractOpenStackTest { - - private AccountResource storage; - - private String container = "test-container"; - private String object = "test-object"; - - @BeforeClass - public void init() { - init("etc/openstack.public.properties"); - storage = client.getStorageEndpoint(); - } - - public void showAccount() { - Response response = storage.head(); - } - - public void updateAccount() { - //Response response = storage.post(); - } - - @Test(priority=1) - public void createContainer() { - Response response = storage.container(container).put(); - } - @Test(priority=2) - public void listContainers() { - List containers = storage.get(); - } - @Test(dependsOnMethods="createContainer", priority=1) - public void showContainer() { - storage.container(container).head(); - } - @Test(dependsOnMethods="createContainer", priority=2) - public void updateContainer() { - //storage.container(container.getName()).post(); - } - - @Test(dependsOnMethods="createContainer", priority=3) - public void createObject() { - //SwiftStorageObjectProperties properties = new SwiftStorageObjectProperties(); - //properties.setName("test-object"); - InputStream is = new ByteArrayInputStream(new byte[1024]); - Response response = storage.container(container).object(object).put(is); - } - - @Test(dependsOnMethods={"createObject"}, priority=4) - public void listObjects() { - storage.container(container).get(); - } - - @Test(dependsOnMethods={"createObject"}, priority=5) - public void showObject() { - storage.container(container).object(object).head(); - } - - @Test(dependsOnMethods="createObject", priority=6) - public void updateObject() { - //storage.container(container).object(object).post(null); - } - - @Test(dependsOnMethods={"createObject"}, priority=7) - public void deleteObject() { - storage.container(container).object(object).delete(); - } - - @Test(dependsOnMethods={"createContainer","deleteObject"}, priority=8) - public void deleteContainer() { - storage.container(container).delete(); - } - -} diff --git a/src/test/java/org/openstack/client/storage/StorageStandaloneIT.java b/src/test/java/org/openstack/client/storage/StorageStandaloneIT.java deleted file mode 100644 index 98412e3af..000000000 --- a/src/test/java/org/openstack/client/storage/StorageStandaloneIT.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.openstack.client.storage; - -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.util.List; -import java.util.Properties; - -import javax.ws.rs.core.Response; - -import org.openstack.api.authentication.SwiftTempAuthenticationProvider; -import org.openstack.api.storage.AccountResource; -import org.openstack.client.StorageClient; -import org.openstack.model.storage.StorageContainer; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class StorageStandaloneIT { - - private AccountResource storage; - - private String container = "test-container"; - private String object = "test-object"; - - @BeforeClass - public void init() { - Properties properties = new Properties(); - properties.put("auth.provider", "org.openstack.api.authentication.SwiftTempAuthenticationProvider"); - properties.put("storage.auth.endpoint", "http://192.168.1.43:8080/auth/v1.0"); - properties.put("storage.auth.account", "admin"); - properties.put("storage.auth.username", "admin"); - properties.put("storage.auth.password", "admin"); - StorageClient client = StorageClient.authenticate(properties); - storage = client.getAccountResource(); - } - - @Test - public void showAccount() { - Response response = storage.head(); - } - - public void updateAccount() { - //Response response = storage.post(); - } - - @Test(priority=1) - public void createContainer() { - Response response = storage.container(container).put(); - } - @Test(priority=2) - public void listContainers() { - List containers = storage.get(); - } - @Test(dependsOnMethods="createContainer", priority=1) - public void showContainer() { - storage.container(container).head(); - } - @Test(dependsOnMethods="createContainer", priority=2) - public void updateContainer() { - //storage.container(container.getName()).post(); - } - - @Test(dependsOnMethods="createContainer", priority=3) - public void createObject() throws Exception { - //SwiftStorageObjectProperties properties = new SwiftStorageObjectProperties(); - //properties.setName("test-object"); - //InputStream is = new ByteArrayInputStream(new byte[1024]); - //InputStream is = new FileInputStream("/Users/woorea/Downloads/D50102GC20_sg2.pdf"); - //File file = new File("/Users/woorea/Downloads/ubuntu-11.10-desktop-amd64.iso"); - File file = new File("/Users/woorea/Downloads/D50102GC20_sg2.pdf"); - //InputStream is = new FileInputStream(file); - Response response = storage.container(container).object(object).put(file); - } - - @Test(dependsOnMethods={"createObject"}, priority=4) - public void listObjects() { - storage.container(container).get(); - } - - @Test(dependsOnMethods={"createObject"}, priority=5) - public void showObject() { - storage.container(container).object(object).head(); - } - - @Test(dependsOnMethods="createObject", priority=6) - public void updateObject() { - //storage.container(container).object(object).post(null); - } - - @Test(dependsOnMethods={"createObject"}, priority=7) - public void deleteObject() { - storage.container(container).object(object).delete(); - } - - @Test(dependsOnMethods={"createContainer","deleteObject"}, priority=8) - public void deleteContainer() { - storage.container(container).delete(); - } - - -} diff --git a/src/test/java/org/openstack/client/utils/RandomDataInputStream.java b/src/test/java/org/openstack/client/utils/RandomDataInputStream.java deleted file mode 100644 index e7168fab1..000000000 --- a/src/test/java/org/openstack/client/utils/RandomDataInputStream.java +++ /dev/null @@ -1,73 +0,0 @@ -package org.openstack.client.utils; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Random; - -public class RandomDataInputStream extends InputStream implements Cloneable { - final int streamLength; - final long seed; - int left; - - final Random random; - - public RandomDataInputStream(int length, long seed) { - this.streamLength = length; - this.seed = seed; - - this.left = length; - this.random = new Random(seed); - } - - @Override - public int read() throws IOException { - byte[] buffer = new byte[1]; - int count = read(buffer); - if (count != 1) - return -1; - return buffer[0] & 0xff; - } - - @Override - public int read(byte[] buffer) throws IOException { - if (left == 0) - return -1; - - int count; - - if (left >= buffer.length) { - count = buffer.length; - random.nextBytes(buffer); - } else { - count = left; - byte[] temp = new byte[count]; - random.nextBytes(temp); - System.arraycopy(temp, 0, buffer, 0, count); - } - left -= count; - return count; - } - - @Override - public int read(byte[] buffer, int offset, int length) throws IOException { - if (offset == 0 && length == buffer.length) { - return read(buffer); - } - - byte[] temp = new byte[length]; - int count = read(temp); - if (count > 0) { - System.arraycopy(temp, 0, buffer, offset, count); - } - return count; - } - - public RandomDataInputStream clone() { - return new RandomDataInputStream(streamLength, seed); - } - - public int getStreamLength() { - return streamLength; - } - -} diff --git a/src/test/java/org/openstack/client/utils/RandomUtil.java b/src/test/java/org/openstack/client/utils/RandomUtil.java deleted file mode 100644 index a2733b5ef..000000000 --- a/src/test/java/org/openstack/client/utils/RandomUtil.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.openstack.client.utils; - -import java.util.Random; - -public class RandomUtil { - final Random random; - - public RandomUtil() { - this.random = new Random(); - } - - public int uniform(int min, int max) { - return random.nextInt(max - min) + min; - } - - public char pick(String s) { - return s.charAt(random.nextInt(s.length())); - } - - public String randomAsciiString(int length) { - char[] chars = new char[length]; - for (int i = 0; i < length; i++) { - chars[i] = (char) uniform(32, 127); - } - return new String(chars); - } - - public String randomAlphanumericString(int length) { - char[] chars = new char[length]; - for (int i = 0; i < length; i++) { - chars[i] = pick("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); - } - return new String(chars); - } - - public String randomAlphanumericString(int minLength, int maxLength) { - int length = uniform(minLength, maxLength); - return randomAlphanumericString(length); - } - - public String randomAsciiString(int minLength, int maxLength) { - int length = uniform(minLength, maxLength); - return randomAsciiString(length); - } - - public String randomUnicode() { - throw new UnsupportedOperationException(); - } - - public long nextLong() { - return random.nextLong(); - } - - public RandomDataInputStream randomStream(int maxLength) { - int imageLength = uniform(1, maxLength); - long seed = random.nextLong(); - return new RandomDataInputStream(imageLength, seed); - } - -} diff --git a/swift-client/pom.xml b/swift-client/pom.xml new file mode 100644 index 000000000..2f30057a8 --- /dev/null +++ b/swift-client/pom.xml @@ -0,0 +1,23 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + swift-client + OpenStack Swift Client + OpenStack Swift Client + + + com.woorea + openstack-client + 3.2.10-SNAPSHOT + + + com.woorea + swift-model + 3.2.10-SNAPSHOT + + + \ No newline at end of file diff --git a/swift-client/src/main/java/com/woorea/openstack/swift/Swift.java b/swift-client/src/main/java/com/woorea/openstack/swift/Swift.java new file mode 100644 index 000000000..0629853b8 --- /dev/null +++ b/swift-client/src/main/java/com/woorea/openstack/swift/Swift.java @@ -0,0 +1,33 @@ +package com.woorea.openstack.swift; + + +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackClientConnector; +import com.woorea.openstack.swift.api.AccountResource; +import com.woorea.openstack.swift.api.ContainersResource; + +public class Swift extends OpenStackClient { + + private final AccountResource ACCOUNT; + + private final ContainersResource CONTAINERS; + + public Swift(String endpoint, OpenStackClientConnector connector) { + super(endpoint, connector); + CONTAINERS = new ContainersResource(this); + ACCOUNT = new AccountResource(this); + } + + public Swift(String endpoint) { + this(endpoint, null); + } + + public ContainersResource containers() { + return CONTAINERS; + } + + public AccountResource account() { + return ACCOUNT; + } + +} diff --git a/swift-client/src/main/java/com/woorea/openstack/swift/api/AccountResource.java b/swift-client/src/main/java/com/woorea/openstack/swift/api/AccountResource.java new file mode 100644 index 000000000..f98fbf923 --- /dev/null +++ b/swift-client/src/main/java/com/woorea/openstack/swift/api/AccountResource.java @@ -0,0 +1,22 @@ +package com.woorea.openstack.swift.api; + +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; + +public class AccountResource { + + private final OpenStackClient CLIENT; + + public AccountResource(OpenStackClient client) { + CLIENT = client; + } + + public class ShowAccount extends OpenStackRequest { + + public ShowAccount() { +// return target.request(MediaType.APPLICATION_JSON).head(); + } + + } + +} diff --git a/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainerResource.java b/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainerResource.java new file mode 100644 index 000000000..c55babe95 --- /dev/null +++ b/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainerResource.java @@ -0,0 +1,143 @@ +package com.woorea.openstack.swift.api; + +import java.util.Map; + + +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.swift.model.ObjectDownload; +import com.woorea.openstack.swift.model.ObjectForUpload; + +public class ContainerResource { + + private final OpenStackClient CLIENT; + + private String container; + + public ContainerResource(OpenStackClient client, String container) { + CLIENT = client; + this.container = container; + } + + public List list() { + return new List(container, null); + } + + public CreateDirectory createDirectory(String path) { + return new CreateDirectory(container, path); + } + + public Show show(String path) { + return new Show(container, path); + } + + public Upload upload(ObjectForUpload objectForUpload) { + return new Upload(objectForUpload); + } + + public Download download(String path) { + return new Download(container, path); + } + + public Delete delete(String path) { + return new Delete(container, path); + } + + public class List extends OpenStackRequest> { + + private String containerName; + + private Map filters; + + public List(String containerName, Map filters) { + this.containerName = containerName; + this.filters = filters; + //returnType(new TypeToken>(){}); +// target = target.path(containerName); +// for(String filter : new String[]{"prefix","delimiter","path","marker"}) { +// if(filters.get(filter) != null) { +// target = target.queryParam(filter, filters.get(filter)); +// } +// } +// return target.request(MediaType.APPLICATION_JSON).get(new GenericType>(){}); + } + + } + + public class CreateDirectory extends OpenStackRequest { + + private String container; + + private String path; + + public CreateDirectory(String container, String path) { + this.container = container; + this.path = path; +// endpoint.path(container).path(path).request().put(Entity.entity(new byte[1],"application/directory")); + } + + } + + public class Show extends OpenStackRequest { + + private String containerName; + + private String objectName; + + public Show(String containerName, String objectName) { + this.containerName = containerName; + this.objectName = objectName; +// return target.path(containerName).path(objectName).request(MediaType.APPLICATION_JSON).head(); + } + + } + + public class Upload extends OpenStackRequest { + + private ObjectForUpload objectForUpload; + + public Upload(ObjectForUpload objectForUpload) { + this.objectForUpload = objectForUpload; +// Invocation.Builder invocationBuilder = target.path(objectForUpload.getContainer()).path(objectForUpload.getName()).request(MediaType.APPLICATION_JSON); +// for(String key : objectForUpload.getProperties().keySet()) { +// invocationBuilder.header("x-object-meta-" + key, objectForUpload.getProperties().get(key)); +// } +// return invocationBuilder.put(Entity.entity(objectForUpload.getInputStream(), MediaType.APPLICATION_OCTET_STREAM), Response.class); + } + + } + + public class Download extends OpenStackRequest { + + private String containerName; + + private String objectName; + + public Download(String containerName, String objectName) { + this.containerName = containerName; + this.objectName = objectName; +// Response response = target.path(containerName).path(objectName).request(MediaType.APPLICATION_JSON).get(); +// ObjectDownload objectDownload = new ObjectDownload(); +// objectDownload.setInputStream((InputStream) response.getEntity()); +// return objectDownload; + } + + } + + + public class Delete extends OpenStackRequest { + + private String containerName; + + private String objectName; + + public Delete(String containerName, String objectName) { + this.containerName = containerName; + this.objectName = objectName; + //return target.path(containerName).path(objectName).request(MediaType.APPLICATION_JSON).delete(); + } + + } + +} diff --git a/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainersResource.java b/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainersResource.java new file mode 100644 index 000000000..aedcc3ff9 --- /dev/null +++ b/swift-client/src/main/java/com/woorea/openstack/swift/api/ContainersResource.java @@ -0,0 +1,74 @@ +package com.woorea.openstack.swift.api; + + +import com.woorea.openstack.base.client.OpenStackClient; +import com.woorea.openstack.base.client.OpenStackRequest; +import com.woorea.openstack.swift.model.Container; + +public class ContainersResource { + + private final OpenStackClient CLIENT; + + public ContainersResource(OpenStackClient client) { + CLIENT = client; + } + + public List list() { + return new List(); + } + + public Create create(String name) { + return new Create(name); + } + + public Show show(String name) { + return new Show(name); + } + + public Delete delete(String name) { + return new Delete(name); + } + + public ContainerResource container(String name) { + return new ContainerResource(CLIENT, name); + } + + public class List extends OpenStackRequest> { + + public List() { + //return target.request(MediaType.APPLICATION_JSON).get(new GenericType>(){}); + } + + } + + + public class Create extends OpenStackRequest { + + public Create(String containerName) { + //return target.path(containerName).request().method("PUT",Entity.text("*")); + } + + } + + public class Show extends OpenStackRequest { + + private String containerName; + + public Show(String containerName) { +// return target.path(containerName).request(MediaType.APPLICATION_JSON).head(); + } + + } + + public class Delete extends OpenStackRequest { + + private String containerName; + + public Delete(String containerName) { + this.containerName = containerName; + //return target.path(containerName).request(MediaType.APPLICATION_JSON).delete(); + } + + } + +} diff --git a/swift-model/pom.xml b/swift-model/pom.xml new file mode 100644 index 000000000..da007e95e --- /dev/null +++ b/swift-model/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + + com.woorea + openstack-java-sdk + 3.2.10-SNAPSHOT + + swift-model + OpenStack Swift Model + OpenStack Swift Model + \ No newline at end of file diff --git a/swift-model/src/main/java/com/woorea/openstack/swift/model/Account.java b/swift-model/src/main/java/com/woorea/openstack/swift/model/Account.java new file mode 100644 index 000000000..8b32ffa99 --- /dev/null +++ b/swift-model/src/main/java/com/woorea/openstack/swift/model/Account.java @@ -0,0 +1,64 @@ +package com.woorea.openstack.swift.model; + +import java.io.Serializable; + +public class Account implements Serializable { + + private Integer containerCount; + + private Integer objectCount; + + private Integer bytesUsed; + + /** + * @return the containerCount + */ + public Integer getContainerCount() { + return containerCount; + } + + /** + * @param containerCount the containerCount to set + */ + public void setContainerCount(Integer containerCount) { + this.containerCount = containerCount; + } + + /** + * @return the objectCount + */ + public Integer getObjectCount() { + return objectCount; + } + + /** + * @param objectCount the objectCount to set + */ + public void setObjectCount(Integer objectCount) { + this.objectCount = objectCount; + } + + /** + * @return the bytesUsed + */ + public Integer getBytesUsed() { + return bytesUsed; + } + + /** + * @param bytesUsed the bytesUsed to set + */ + public void setBytesUsed(Integer bytesUsed) { + this.bytesUsed = bytesUsed; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Account [containerCount=" + containerCount + ", objectCount=" + + objectCount + ", bytesUsed=" + bytesUsed + "]"; + } + +} diff --git a/swift-model/src/main/java/com/woorea/openstack/swift/model/Container.java b/swift-model/src/main/java/com/woorea/openstack/swift/model/Container.java new file mode 100644 index 000000000..f61c435b2 --- /dev/null +++ b/swift-model/src/main/java/com/woorea/openstack/swift/model/Container.java @@ -0,0 +1,70 @@ +package com.woorea.openstack.swift.model; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Container implements Serializable { + + private String name; + + @JsonProperty("count") + private Integer objectCount; + + @JsonProperty("bytes") + private Long bytesUsed; + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the objectCount + */ + public Integer getObjectCount() { + return objectCount; + } + + /** + * @param objectCount the objectCount to set + */ + public void setObjectCount(Integer objectCount) { + this.objectCount = objectCount; + } + + /** + * @return the bytesUsed + */ + public Long getBytesUsed() { + return bytesUsed; + } + + /** + * @param bytesUsed the bytesUsed to set + */ + public void setBytesUsed(Long bytesUsed) { + this.bytesUsed = bytesUsed; + } + + /* (non-Javadoc) + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Container [name=" + name + ", objectCount=" + objectCount + + ", bytesUsed=" + bytesUsed + "]"; + } + + + +} diff --git a/swift-model/src/main/java/com/woorea/openstack/swift/model/Object.java b/swift-model/src/main/java/com/woorea/openstack/swift/model/Object.java new file mode 100644 index 000000000..1ba18e1f3 --- /dev/null +++ b/swift-model/src/main/java/com/woorea/openstack/swift/model/Object.java @@ -0,0 +1,108 @@ +package com.woorea.openstack.swift.model; + +import java.io.Serializable; +import java.util.Calendar; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Object implements Serializable { + + private String subdir; + + private String name; + + private String hash; + + private int bytes; + + @JsonProperty("content_type") + private String contentType; + + @JsonProperty("last_modified") + private Calendar lastModified; + + /** + * @return the subdir + */ + public String getSubdir() { + return subdir; + } + + /** + * @param subdir the subdir to set + */ + public void setSubdir(String subdir) { + this.subdir = subdir; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return the hash + */ + public String getHash() { + return hash; + } + + /** + * @param hash the hash to set + */ + public void setHash(String hash) { + this.hash = hash; + } + + /** + * @return the bytes + */ + public int getBytes() { + return bytes; + } + + /** + * @param bytes the bytes to set + */ + public void setBytes(int bytes) { + this.bytes = bytes; + } + + /** + * @return the contentType + */ + public String getContentType() { + return contentType; + } + + /** + * @param contentType the contentType to set + */ + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * @return the lastModified + */ + public Calendar getLastModified() { + return lastModified; + } + + /** + * @param lastModified the lastModified to set + */ + public void setLastModified(Calendar lastModified) { + this.lastModified = lastModified; + } + +} diff --git a/swift-model/src/main/java/com/woorea/openstack/swift/model/ObjectDownload.java b/swift-model/src/main/java/com/woorea/openstack/swift/model/ObjectDownload.java new file mode 100644 index 000000000..00f0ff807 --- /dev/null +++ b/swift-model/src/main/java/com/woorea/openstack/swift/model/ObjectDownload.java @@ -0,0 +1,41 @@ +package com.woorea.openstack.swift.model; + +import java.io.InputStream; + + + +public class ObjectDownload { + + private Object object; + + private InputStream inputStream; + + /** + * @return the object + */ + public Object getObject() { + return object; + } + + /** + * @param object the object to set + */ + public void setObject(Object object) { + this.object = object; + } + + /** + * @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/swift-model/src/main/java/com/woorea/openstack/swift/model/ObjectForUpload.java b/swift-model/src/main/java/com/woorea/openstack/swift/model/ObjectForUpload.java new file mode 100644 index 000000000..fd560b668 --- /dev/null +++ b/swift-model/src/main/java/com/woorea/openstack/swift/model/ObjectForUpload.java @@ -0,0 +1,72 @@ +package com.woorea.openstack.swift.model; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + + +public class ObjectForUpload { + + private String container; + + private String name; + + private Map properties; + + private InputStream inputStream; + + /** + * @return the container + */ + public String getContainer() { + return container; + } + + /** + * @param container the container to set + */ + public void setContainer(String container) { + this.container = container; + } + + /** + * @return the name + */ + public String getName() { + return name; + } + + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + + /** + * @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; + } + + + +}