├── .gitignore
├── .travis.yml
├── LICENSE.txt
├── NEWS.md
├── README.textile
├── bundle.sh
├── ceilometer-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── ceilometer
│ ├── Ceilometer.java
│ ├── QueriableCeilometerCommand.java
│ └── v2
│ └── api
│ ├── MetersResource.java
│ └── ResourcesResource.java
├── ceilometer-model
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── ceilometer
│ └── v2
│ └── model
│ ├── Meter.java
│ ├── Resource.java
│ ├── Sample.java
│ └── Statistics.java
├── cinder-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── cinder
│ ├── Cinder.java
│ ├── LimitsExtension.java
│ ├── SchedulerStatsExtension.java
│ ├── SnapshotsExtension.java
│ ├── VolumeTypesExtension.java
│ └── VolumesExtension.java
├── cinder-model
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── cinder
│ └── model
│ ├── BaseConnection.java
│ ├── Capabilities.java
│ ├── ConnectionForInitialize.java
│ ├── ConnectionForTerminate.java
│ ├── ConnectionInfo.java
│ ├── Limits.java
│ ├── Metadata.java
│ ├── Pool.java
│ ├── Pools.java
│ ├── Snapshot.java
│ ├── SnapshotForCreate.java
│ ├── SnapshotForUpdate.java
│ ├── Snapshots.java
│ ├── Volume.java
│ ├── VolumeForCreate.java
│ ├── VolumeForExtend.java
│ ├── VolumeForImageCreate.java
│ ├── VolumeForUpdate.java
│ ├── VolumeType.java
│ ├── VolumeTypeForCreate.java
│ ├── VolumeTypes.java
│ └── Volumes.java
├── glance-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── glance
│ ├── Glance.java
│ ├── ImagesResource.java
│ ├── SharedImagesResource.java
│ └── v2
│ ├── Glance.java
│ └── ImagesResource.java
├── glance-model
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── glance
│ └── model
│ ├── Image.java
│ ├── ImageDownload.java
│ ├── ImageMember.java
│ ├── ImageMembers.java
│ ├── ImageUpload.java
│ ├── Images.java
│ ├── SharedImage.java
│ ├── SharedImages.java
│ └── v2
│ ├── Image.java
│ ├── ImageDownload.java
│ └── Images.java
├── heat-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── heat
│ ├── Heat.java
│ ├── ResourcesResource.java
│ └── StackResource.java
├── heat-model
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── heat
│ └── model
│ ├── CreateStackParam.java
│ ├── Explanation.java
│ ├── Link.java
│ ├── Resource.java
│ ├── Resources.java
│ ├── Stack.java
│ └── Stacks.java
├── keystone-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── keystone
│ ├── Keystone.java
│ ├── api
│ ├── EndpointsResource.java
│ ├── RolesResource.java
│ ├── ServicesResource.java
│ ├── TenantsResource.java
│ ├── TokensResource.java
│ └── UsersResource.java
│ ├── utils
│ ├── KeystoneTokenProvider.java
│ └── KeystoneUtils.java
│ └── v3
│ ├── Keystone.java
│ └── api
│ ├── CredentialsResources.java
│ ├── DomainGroupRolesResource.java
│ ├── DomainUserRolesResource.java
│ ├── DomainsResource.java
│ ├── EndpointsResource.java
│ ├── GenericResource.java
│ ├── GroupUsersResource.java
│ ├── GroupsResource.java
│ ├── PoliciesResource.java
│ ├── ProjectGroupRolesResource.java
│ ├── ProjectRolesResource.java
│ ├── ProjectUserRolesResource.java
│ ├── ProjectsResource.java
│ ├── RolesResource.java
│ ├── ServicesResource.java
│ ├── TokensResource.java
│ └── UsersResource.java
├── keystone-model
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── keystone
│ ├── model
│ ├── Access.java
│ ├── Authentication.java
│ ├── Endpoint.java
│ ├── Endpoints.java
│ ├── Error.java
│ ├── Link.java
│ ├── Role.java
│ ├── Roles.java
│ ├── Service.java
│ ├── Services.java
│ ├── Tenant.java
│ ├── Tenants.java
│ ├── Token.java
│ ├── User.java
│ ├── Users.java
│ └── authentication
│ │ ├── AccessKey.java
│ │ ├── TokenAuthentication.java
│ │ └── UsernamePassword.java
│ └── v3
│ └── model
│ ├── Authentication.java
│ ├── Credential.java
│ ├── Credentials.java
│ ├── Domain.java
│ ├── Domains.java
│ ├── Endpoint.java
│ ├── Endpoints.java
│ ├── Group.java
│ ├── Groups.java
│ ├── Policies.java
│ ├── Policy.java
│ ├── Project.java
│ ├── Projects.java
│ ├── Role.java
│ ├── Roles.java
│ ├── Service.java
│ ├── Services.java
│ ├── Token.java
│ ├── User.java
│ └── Users.java
├── nova-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── nova
│ ├── Nova.java
│ └── api
│ ├── ExtensionsResource.java
│ ├── FlavorsResource.java
│ ├── HypervisorsResource.java
│ ├── ImagesResource.java
│ ├── QuotaSetsResource.java
│ ├── ServersResource.java
│ ├── ServicesResource.java
│ └── extensions
│ ├── AggregatesExtension.java
│ ├── CloudpipesExtension.java
│ ├── CredentialsExtension.java
│ ├── FloatingIpDnsExtension.java
│ ├── FloatingIpPoolsExtension.java
│ ├── FloatingIpsExtension.java
│ ├── HostsExtension.java
│ ├── HypervisorsExtension.java
│ ├── KeyPairsExtension.java
│ ├── NetworksExtension.java
│ ├── SecurityGroupsExtension.java
│ ├── SnapshotsExtension.java
│ └── VolumesExtension.java
├── nova-model
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── nova
│ └── model
│ ├── Certificate.java
│ ├── Cloudpipe.java
│ ├── Cloudpipes.java
│ ├── Extension.java
│ ├── Extensions.java
│ ├── Flavor.java
│ ├── FlavorForCreate.java
│ ├── Flavors.java
│ ├── FloatingIp.java
│ ├── FloatingIpDomain.java
│ ├── FloatingIpDomains.java
│ ├── FloatingIpPools.java
│ ├── FloatingIps.java
│ ├── Host.java
│ ├── HostAggregate.java
│ ├── HostAggregates.java
│ ├── Hosts.java
│ ├── Hypervisor.java
│ ├── Hypervisors.java
│ ├── Image.java
│ ├── ImageFromVolume.java
│ ├── Images.java
│ ├── KeyPair.java
│ ├── KeyPairs.java
│ ├── Limits.java
│ ├── Link.java
│ ├── Metadata.java
│ ├── Network.java
│ ├── NetworkForCreate.java
│ ├── Networks.java
│ ├── PersonalityFile.java
│ ├── QuotaSet.java
│ ├── SecurityGroup.java
│ ├── SecurityGroupForCreate.java
│ ├── SecurityGroupRuleForCreate.java
│ ├── SecurityGroups.java
│ ├── Server.java
│ ├── ServerAction.java
│ ├── ServerForCreate.java
│ ├── Servers.java
│ ├── Service.java
│ ├── Services.java
│ ├── SimpleTenantUsage.java
│ ├── SimpleTenantUsages.java
│ ├── Snapshot.java
│ ├── SnapshotForCreate.java
│ ├── Snapshots.java
│ ├── Volume.java
│ ├── VolumeAttachment.java
│ ├── VolumeAttachments.java
│ ├── VolumeForCreate.java
│ ├── VolumeForImageCreate.java
│ ├── VolumeType.java
│ ├── VolumeTypes.java
│ └── Volumes.java
├── openstack-client-connectors
├── jersey-connector
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── woorea
│ │ │ └── openstack
│ │ │ └── connector
│ │ │ ├── JerseyConnector.java
│ │ │ └── JerseyResponse.java
│ │ └── resources
│ │ └── META-INF
│ │ └── services
│ │ └── com.woorea.openstack.base.client.OpenStackClientConnector
├── jersey2-connector
│ ├── pom.xml
│ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── woorea
│ │ │ └── openstack
│ │ │ └── connector
│ │ │ ├── JaxRs20Connector.java
│ │ │ ├── JaxRs20Response.java
│ │ │ └── OpenStack.java
│ │ └── resources
│ │ └── META-INF
│ │ └── services
│ │ └── com.woorea.openstack.base.client.OpenStackClientConnector
├── pom.xml
└── resteasy-connector
│ ├── pom.xml
│ └── src
│ └── main
│ ├── java
│ └── com
│ │ └── woorea
│ │ └── openstack
│ │ └── connector
│ │ ├── RESTEasyConnector.java
│ │ ├── RESTEasyInputStream.java
│ │ └── RESTEasyResponse.java
│ └── resources
│ └── META-INF
│ └── services
│ └── com.woorea.openstack.base.client.OpenStackClientConnector
├── openstack-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ ├── base
│ └── client
│ │ ├── Entity.java
│ │ ├── HttpMethod.java
│ │ ├── OpenStackClient.java
│ │ ├── OpenStackClientConnector.java
│ │ ├── OpenStackCommand.java
│ │ ├── OpenStackRequest.java
│ │ ├── OpenStackResponse.java
│ │ ├── OpenStackResponseException.java
│ │ ├── OpenStackResponseStatus.java
│ │ ├── OpenStackSimpleTokenProvider.java
│ │ └── OpenStackTokenProvider.java
│ └── common
│ ├── client
│ └── AbstractOpenStackClient.java
│ └── session
│ ├── OpenStackSession.java
│ └── OpenStackSessionHolder.java
├── openstack-console
├── pom.xml
└── src
│ └── main
│ ├── java
│ └── com
│ │ └── woorea
│ │ └── openstack
│ │ └── console
│ │ ├── Command.java
│ │ ├── CommandLineHelper.java
│ │ ├── Commands.java
│ │ ├── Console.java
│ │ ├── Environment.java
│ │ ├── Main.java
│ │ ├── keystone
│ │ ├── KeystoneCommand.java
│ │ ├── KeystoneEnvironment.java
│ │ ├── KeystoneRoleCreate.java
│ │ ├── KeystoneRoleDelete.java
│ │ ├── KeystoneRoleList.java
│ │ ├── KeystoneServiceList.java
│ │ ├── KeystoneTenantCreate.java
│ │ ├── KeystoneTenantDelete.java
│ │ ├── KeystoneTenantList.java
│ │ ├── KeystoneUserCreate.java
│ │ ├── KeystoneUserDelete.java
│ │ ├── KeystoneUserList.java
│ │ └── KeystoneUserShow.java
│ │ ├── nova
│ │ ├── NovaCommand.java
│ │ ├── NovaEnvironment.java
│ │ └── NovaServerList.java
│ │ └── utils
│ │ ├── Column.java
│ │ ├── ConsoleUtils.java
│ │ ├── Table.java
│ │ └── TableModel.java
│ └── resources
│ └── console.properties
├── openstack-examples
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── examples
│ ├── ExamplesConfiguration.java
│ ├── compute
│ ├── NovaCreateServer.java
│ ├── NovaListFlavors.java
│ ├── NovaListImages.java
│ ├── NovaListServers.java
│ └── NovaStopStartServer.java
│ ├── glance
│ └── GlanceListImages.java
│ ├── heat
│ └── HeatListStacks.java
│ ├── hpcloud
│ ├── Keystone3Authentication.java
│ └── KeystoneAuthentication.java
│ ├── keystone
│ ├── KeystoneCreateTenant.java
│ └── KeystoneCreateUser.java
│ ├── metering
│ └── v2
│ │ └── TestAll.java
│ ├── network
│ ├── QuantumListNetworks.java
│ ├── QuantumNetworkCreate.java
│ └── QuantumQueryNetworks.java
│ ├── objectstore
│ └── SwiftExample.java
│ └── simple
│ └── OpenStackSimpleClient.java
├── pom.xml
├── quantum-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── quantum
│ ├── Quantum.java
│ └── api
│ ├── NetworksResource.java
│ ├── PortsResource.java
│ ├── RoutersResource.java
│ ├── SubnetsResource.java
│ └── query
│ └── AbsOpenStackCmd.java
├── quantum-model
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── com
│ │ └── woorea
│ │ └── openstack
│ │ └── quantum
│ │ └── model
│ │ ├── GatewayInfo.java
│ │ ├── HostRoute.java
│ │ ├── Network.java
│ │ ├── NetworkForCreate.java
│ │ ├── Networks.java
│ │ ├── Pool.java
│ │ ├── Port.java
│ │ ├── PortForCreate.java
│ │ ├── Ports.java
│ │ ├── Router.java
│ │ ├── RouterForAddInterface.java
│ │ ├── RouterForCreate.java
│ │ ├── RouterInterface.java
│ │ ├── Routers.java
│ │ ├── Subnet.java
│ │ ├── SubnetForCreate.java
│ │ └── Subnets.java
│ └── test
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── quantum
│ └── model
│ ├── NetworkTest.java
│ ├── PortTest.java
│ └── SubnetTest.java
├── swift-client
├── pom.xml
└── src
│ └── main
│ └── java
│ └── com
│ └── woorea
│ └── openstack
│ └── swift
│ ├── Swift.java
│ └── api
│ ├── AccountResource.java
│ ├── ContainerResource.java
│ └── ContainersResource.java
└── swift-model
├── pom.xml
└── src
└── main
└── java
└── com
└── woorea
└── openstack
└── swift
└── model
├── Account.java
├── Container.java
├── Object.java
├── ObjectDownload.java
└── ObjectForUpload.java
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.iml
3 | .idea/
4 | .settings/
5 | .classpath
6 | .project
7 | .settings/
8 | target/
9 | bin/logs/
10 |
11 |
12 | openstack-api/test-output/
13 | openstack-ui/src/main/webapp/META-INF/
14 | openstack-ui/src/main/webapp/WEB-INF/deploy/
15 | openstack-ui/src/main/webapp/WEB-INF/classes/
16 | openstack-ui/src/main/gwt-unitCache/
17 | openstack-ui/src/main/webapp/ui/
18 | openstack-ui/src/main/webapp/WEB-INF/lib/
19 | openstack-ui/.gwt/
20 | openstack-ui/deploy.sh
21 | test-output/
22 | bin
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 |
3 | install: mvn clean package -DskipTests=true
--------------------------------------------------------------------------------
/NEWS.md:
--------------------------------------------------------------------------------
1 | # 3.2.9 / 2020-04-07
2 | * glance: Add Support for Image Service API v2
3 |
4 | # 3.2.8 / 2020-01-29
5 | * jackson upgraded to com.fasterxml version 2.9.x
6 | * commons-httpclient upgraded to org.apache.httpcomponents 4.5
7 |
8 | # 3.2.7 / 2019-05-03
9 | * Remove maven-gpg-plugin
10 |
11 | # 3.2.6 / 2019-05-03
12 | * RESTEasyConnector: Support RESTEasy 3.6.3.Final
13 |
14 | # 3.2.5 / 2018-11-14
15 | * neutron: Add support for `port_security_enabled` on Networks
16 |
17 | # 3.2.4 / 2018
18 | * Improved backward compatibility to 3.1.3
19 |
20 | # 3.2.3 / 2018-06-24
21 | * No user visible changes
22 |
23 | # 3.2.2 / 2018-06-23
24 | * Add keystone v3 support
25 | * Add missing nova utility methods for server actions
26 | * Add heat support
27 | * Add router support
28 | * All fixes and improvements up to 3.1.3
29 |
30 | # 3.1.3 / 2018-05-18
31 | * Cinder: Add support for `os-terminate_connection`
32 | * neutron: Support parameter mtu
33 |
34 | # 3.1.2 / 2017-01-28
35 | * RESTEasyConnector: Isolate the creation of ClientExecutor
36 |
37 | # 3.1.1 / 2015-05-06
38 | * cinder: introduce client and model
39 | * java 7
40 | * Fixes and improvements up to 3.0.6
41 |
42 | # 3.2.1 / 2013-07-26
43 | * No user visible changes
44 |
45 | # 3.2.0 / 2013-07-26
46 | * support quota/limits/usage operations
47 | * logging enhancements
48 |
49 | # 3.1.0 / 2013-07-21
50 |
51 |
--------------------------------------------------------------------------------
/bundle.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | mvn source:jar javadoc:jar package gpg:sign repository:bundle-create -Dgpg.passphrase=$1
--------------------------------------------------------------------------------
/ceilometer-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | ceilometer-client
9 | OpenStack Ceilometer Client
10 | OpenStack Ceilometer Client
11 |
12 |
13 | com.woorea
14 | openstack-client
15 | 3.2.10-SNAPSHOT
16 |
17 |
18 | com.woorea
19 | ceilometer-model
20 | 3.2.10-SNAPSHOT
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/Ceilometer.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.ceilometer;
2 |
3 |
4 | import com.woorea.openstack.base.client.OpenStackClient;
5 | import com.woorea.openstack.base.client.OpenStackClientConnector;
6 | import com.woorea.openstack.ceilometer.v2.api.MetersResource;
7 | import com.woorea.openstack.ceilometer.v2.api.ResourcesResource;
8 |
9 | public class Ceilometer extends OpenStackClient {
10 |
11 | private final MetersResource METERS;
12 |
13 | private final ResourcesResource RESOURCES;
14 |
15 | public Ceilometer(String endpoint, OpenStackClientConnector connector) {
16 | super(endpoint, connector);
17 | METERS = new MetersResource(this);
18 | RESOURCES = new ResourcesResource(this);
19 | }
20 |
21 | public Ceilometer(String endpoint) {
22 | this(endpoint, null);
23 |
24 | }
25 |
26 | public ResourcesResource resources() {
27 | return RESOURCES;
28 | }
29 |
30 | public MetersResource meters() {
31 | return METERS;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/QueriableCeilometerCommand.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.ceilometer;
2 |
3 | import java.io.Serializable;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | import com.woorea.openstack.base.client.OpenStackRequest;
8 |
9 | public abstract class QueriableCeilometerCommand extends OpenStackRequest {
10 |
11 | protected List fields = new ArrayList();
12 |
13 | protected List ops = new ArrayList();
14 |
15 | protected List values = new ArrayList();
16 |
17 | private T filter(String field, String op, Serializable value) {
18 | fields.add(field);
19 | ops.add(op);
20 | values.add(value);
21 | return (T) this;
22 | }
23 |
24 | public T lt(String field, Serializable value) {
25 | return filter(field, "lt", value);
26 | }
27 |
28 | public T le(String field, Serializable value) {
29 | return filter(field, "le", value);
30 | }
31 |
32 | public T eq(String field, Serializable value) {
33 | return filter(field, "eq", value);
34 | }
35 |
36 | public T ne(String field, Serializable value) {
37 | return filter(field, "ne", value);
38 | }
39 |
40 | public T ge(String field, Serializable value) {
41 | return filter(field, "ge", value);
42 | }
43 |
44 | public T gt(String field, Serializable value) {
45 | return filter(field, "gt", value);
46 | }
47 |
48 | /*
49 | public WebTarget query(WebTarget target) {
50 | if(fields.size() > 0) {
51 | target = target.queryParam("q.field", fields.toArray());
52 | target = target.queryParam("q.op", ops.toArray());
53 | target = target.queryParam("q.value", values.toArray());
54 | }
55 | return target;
56 | }
57 | */
58 | }
59 |
--------------------------------------------------------------------------------
/ceilometer-client/src/main/java/com/woorea/openstack/ceilometer/v2/api/ResourcesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.ceilometer.v2.api;
2 |
3 | import java.util.List;
4 |
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.ceilometer.QueriableCeilometerCommand;
8 | import com.woorea.openstack.ceilometer.v2.model.Resource;
9 |
10 | public class ResourcesResource {
11 |
12 | private final OpenStackClient CLIENT;
13 |
14 | public ResourcesResource(OpenStackClient client) {
15 | CLIENT = client;
16 | }
17 |
18 | public class ResourceList extends QueriableCeilometerCommand> {
19 |
20 | public ResourceList() {
21 | OpenStackRequest request = new OpenStackRequest();
22 | //return query(target.path("resources")).request(MediaType.APPLICATION_JSON).get(new GenericType>() {});
23 | }
24 |
25 | }
26 |
27 | public class ResourceShow extends OpenStackRequest {
28 |
29 | private String id;
30 |
31 | public ResourceShow id(String id) {
32 | this.id = id;
33 | return this;
34 | }
35 |
36 | public ResourceShow(OpenStackClient client) {
37 | // if(id == null) {
38 | // throw new UnsupportedOperationException("resource id is mandatory");
39 | // }
40 | // return target.path("resources").path(id).request(MediaType.APPLICATION_JSON).get(Resource.class);
41 | }
42 |
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/ceilometer-model/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | ceilometer-model
9 | OpenStack Ceilometer Model
10 | OpenStack Ceilometer Model
11 |
12 |
--------------------------------------------------------------------------------
/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Meter.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.ceilometer.v2.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | public class Meter {
6 |
7 | @JsonProperty("user_id")
8 | private String user;
9 |
10 |
11 | private String name;
12 |
13 | @JsonProperty("resource_id")
14 | private String resource;
15 |
16 | @JsonProperty("project_id")
17 | private String project;
18 |
19 | private String type;
20 |
21 | private String unit;
22 |
23 | public String getUser() {
24 | return user;
25 | }
26 |
27 | public String getName() {
28 | return name;
29 | }
30 |
31 | public String getResource() {
32 | return resource;
33 | }
34 |
35 | public String getProject() {
36 | return project;
37 | }
38 |
39 | public String getType() {
40 | return type;
41 | }
42 |
43 | public String getUnit() {
44 | return unit;
45 | }
46 |
47 | @Override
48 | public String toString() {
49 | return "Meter [user=" + user + ", name=" + name + ", resource="
50 | + resource + ", project=" + project + ", type=" + type
51 | + ", unit=" + unit + "]";
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/ceilometer-model/src/main/java/com/woorea/openstack/ceilometer/v2/model/Resource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.ceilometer.v2.model;
2 |
3 | import java.util.Map;
4 |
5 | import com.fasterxml.jackson.annotation.JsonProperty;
6 |
7 | public class Resource {
8 | //{"resource_id": "23b55841eedd41e99d5f3f32149ca086", "timestamp": "2013-03-03T15:19:00", "project_id": "23b55841eedd41e99d5f3f32149ca086", "user_id": null, "metadata": {}}
9 |
10 | @JsonProperty("resource_id")
11 | private String resource;
12 |
13 | private String timestamp;
14 |
15 | @JsonProperty("project_id")
16 | private String project;
17 |
18 | @JsonProperty("user_id")
19 | private String user;
20 |
21 | private Map metadata;
22 |
23 | public String getResource() {
24 | return resource;
25 | }
26 |
27 | public String getTimestamp() {
28 | return timestamp;
29 | }
30 |
31 | public String getProject() {
32 | return project;
33 | }
34 |
35 | public String getUser() {
36 | return user;
37 | }
38 |
39 | public Map getMetadata() {
40 | return metadata;
41 | }
42 |
43 | @Override
44 | public String toString() {
45 | return "Resource [resource=" + resource + ", timestamp=" + timestamp
46 | + ", project=" + project + ", user=" + user + ", metadata="
47 | + metadata + "]";
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/cinder-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | cinder-client
9 | OpenStack Cinder Client
10 | OpenStack Cinder Client
11 |
12 |
13 | com.woorea
14 | openstack-client
15 | 3.2.10-SNAPSHOT
16 |
17 |
18 |
19 | com.woorea
20 | cinder-model
21 | 3.2.10-SNAPSHOT
22 |
23 |
24 |
--------------------------------------------------------------------------------
/cinder-client/src/main/java/com/woorea/openstack/cinder/Cinder.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.base.client.OpenStackClientConnector;
5 |
6 | public class Cinder extends OpenStackClient {
7 |
8 | private final VolumesExtension VOLUMES;
9 |
10 | private final SnapshotsExtension SNAPSHOTS;
11 |
12 | private final VolumeTypesExtension VOLUME_TYPES;
13 |
14 | private final LimitsExtension LIMITS;
15 |
16 | private final SchedulerStatsExtension SCHEDULER_STATS;
17 |
18 | public Cinder(String endpoint, OpenStackClientConnector connector) {
19 | super(endpoint, connector);
20 | VOLUMES = new VolumesExtension(this);
21 | SNAPSHOTS = new SnapshotsExtension(this);
22 | VOLUME_TYPES = new VolumeTypesExtension(this);
23 | LIMITS = new LimitsExtension(this);
24 | SCHEDULER_STATS = new SchedulerStatsExtension(this);
25 | }
26 |
27 | public Cinder(String endpoint) {
28 | this(endpoint, null);
29 | }
30 |
31 | public final VolumesExtension volumes() {
32 | return VOLUMES;
33 | }
34 |
35 | public final SnapshotsExtension snapshots() {
36 | return SNAPSHOTS;
37 | }
38 |
39 | public final VolumeTypesExtension volumeTypes() {
40 | return VOLUME_TYPES;
41 | }
42 |
43 | public final LimitsExtension limits() {
44 | return LIMITS;
45 | }
46 |
47 | public final SchedulerStatsExtension schedulerStats() {
48 | return SCHEDULER_STATS;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/cinder-client/src/main/java/com/woorea/openstack/cinder/LimitsExtension.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder;
2 |
3 | import com.woorea.openstack.base.client.HttpMethod;
4 | import com.woorea.openstack.base.client.OpenStackClient;
5 | import com.woorea.openstack.base.client.OpenStackRequest;
6 | import com.woorea.openstack.cinder.model.Limits;
7 |
8 | public class LimitsExtension {
9 |
10 | private final OpenStackClient CLIENT;
11 |
12 | public LimitsExtension(OpenStackClient client) {
13 | CLIENT = client;
14 | }
15 |
16 | public List list() {
17 | return new List();
18 | }
19 |
20 | public class List extends OpenStackRequest {
21 |
22 | public List() {
23 | super(CLIENT, HttpMethod.GET, "/limits", null, Limits.class);
24 | }
25 |
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/cinder-client/src/main/java/com/woorea/openstack/cinder/SchedulerStatsExtension.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder;
2 |
3 | import com.woorea.openstack.base.client.HttpMethod;
4 | import com.woorea.openstack.base.client.OpenStackClient;
5 | import com.woorea.openstack.base.client.OpenStackRequest;
6 | import com.woorea.openstack.cinder.model.Pools;
7 |
8 | /**
9 | * Cinder Scheduler Stats Management
10 | */
11 | public class SchedulerStatsExtension {
12 |
13 | private final OpenStackClient CLIENT;
14 |
15 | public SchedulerStatsExtension(OpenStackClient client) {
16 | this.CLIENT = client;
17 | }
18 |
19 | public List list(boolean detail) {
20 | return new List(detail);
21 | }
22 |
23 | public class List extends OpenStackRequest {
24 |
25 | public List(boolean detail) {
26 | super(CLIENT, HttpMethod.GET, (new StringBuilder("/scheduler-stats/get_pools")).append(detail ? "?detail=True":""), null, Pools.class);
27 | }
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/cinder-model/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | cinder-model
9 | OpenStack Cinder Model
10 | OpenStack Cinder Model
11 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/BaseConnection.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.HashMap;
5 | import java.util.Map;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public abstract class BaseConnection implements Serializable {
10 | @JsonProperty("connector")
11 | private Map connector = new HashMap();
12 |
13 | /**
14 | * @return the connector
15 | */
16 | public Map getConnector() {
17 | return connector;
18 | }
19 |
20 | /**
21 | * @param connector
22 | * the connector to set
23 | */
24 | public void setConnector(Map connector) {
25 | this.connector = connector;
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionForInitialize.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonRootName;
4 |
5 | import java.io.Serializable;
6 |
7 | @JsonRootName("os-initialize_connection")
8 | public class ConnectionForInitialize extends BaseConnection implements Serializable {
9 |
10 | /*
11 | * (non-Javadoc)
12 | *
13 | * @see java.lang.Object#toString()
14 | */
15 | @Override
16 | public String toString() {
17 | return "ConnectionForInitialize [connector=" + getConnector() + "]";
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionForTerminate.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonRootName;
4 |
5 | import java.io.Serializable;
6 |
7 | @JsonRootName("os-terminate_connection")
8 | public class ConnectionForTerminate extends BaseConnection implements Serializable {
9 |
10 | /*
11 | * (non-Javadoc)
12 | *
13 | * @see java.lang.Object#toString()
14 | */
15 | @Override
16 | public String toString() {
17 | return "ConnectionForInitialize [connector=" + getConnector() + "]";
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/ConnectionInfo.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Map;
5 |
6 | import com.fasterxml.jackson.annotation.JsonProperty;
7 | import com.fasterxml.jackson.annotation.JsonRootName;
8 |
9 | @JsonRootName("connection_info")
10 | public class ConnectionInfo implements Serializable {
11 |
12 | @JsonProperty("driver_volume_type")
13 | private String driverVolumeType;
14 |
15 | private Map data;
16 |
17 | /**
18 | * @return the driverVolumeType
19 | */
20 | public String getDriverVolumeType() {
21 | return driverVolumeType;
22 | }
23 |
24 | /**
25 | * @param driverVolumeType
26 | * the driverVolumeType to set
27 | */
28 | public void setDriverVolumeType(String driverVolumeType) {
29 | this.driverVolumeType = driverVolumeType;
30 | }
31 |
32 | /**
33 | * @return the data
34 | */
35 | public Map getData() {
36 | return data;
37 | }
38 |
39 | /**
40 | * @param data
41 | * the data to set
42 | */
43 | public void setData(Map data) {
44 | this.data = data;
45 | }
46 |
47 | /*
48 | * (non-Javadoc)
49 | *
50 | * @see java.lang.Object#toString()
51 | */
52 | @Override
53 | public String toString() {
54 | return "ConnectionInfo [driverVolumeType=" + driverVolumeType + "," +
55 | " data=" + data + "]";
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Metadata.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.util.Map;
4 |
5 | public class Metadata {
6 |
7 | private Map metadata;
8 |
9 | /**
10 | * @return the metadata
11 | */
12 | public Map getMetadata() {
13 | return metadata;
14 | }
15 |
16 | /**
17 | * Set the metadata
18 | *
19 | * @param metadata
20 | */
21 | public void setMetadata(Map metadata) {
22 | this.metadata = metadata;
23 | }
24 |
25 | /*
26 | * (non-Javadoc)
27 | *
28 | * @see java.lang.Object#toString()
29 | */
30 | @Override
31 | public String toString() {
32 | return "Metadata [metadata=" + metadata + "]";
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Pool.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 | import java.util.Map;
6 | import com.fasterxml.jackson.annotation.JsonProperty;
7 | import com.fasterxml.jackson.annotation.JsonRootName;
8 |
9 | /**
10 | * Model for Pool
11 | */
12 | @JsonRootName("pool")
13 | public class Pool implements Serializable {
14 |
15 | private String name;
16 |
17 | private Capabilities capabilities;
18 |
19 | public String getName() {
20 | return name;
21 | }
22 |
23 | public void setName(String name) {
24 | this.name = name;
25 | }
26 |
27 | public Capabilities getCapabilities() {
28 | return capabilities;
29 | }
30 |
31 | public void setCapabilities(Capabilities capabilities) {
32 | this.capabilities = capabilities;
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | return "Pool{"
38 | + "name='" + name
39 | + ", capabilities='" + capabilities
40 | + '}';
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Pools.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 | import com.fasterxml.jackson.annotation.JsonProperty;
7 |
8 | /**
9 | * Model for List of pools
10 | */
11 | public class Pools implements Iterable, Serializable {
12 |
13 | @JsonProperty("pools")
14 | private List list;
15 |
16 | public List getList() {
17 | return list;
18 | }
19 |
20 | public void setList(List list) {
21 | this.list = list;
22 | }
23 |
24 | @Override
25 | public Iterator iterator() {
26 | return list.iterator();
27 | }
28 |
29 | @Override
30 | public String toString() {
31 | return "Pools [list=" + list + "]";
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/SnapshotForUpdate.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | @JsonRootName("snapshot")
8 | public class SnapshotForUpdate implements Serializable {
9 |
10 | private String name;
11 |
12 | private String description;
13 |
14 | /**
15 | * @return the name
16 | */
17 | public String getName() {
18 | return name;
19 | }
20 |
21 | /**
22 | * @param name
23 | * the name to set
24 | */
25 | public void setName(String name) {
26 | this.name = name;
27 | }
28 |
29 | /**
30 | * @return the description
31 | */
32 | public String getDescription() {
33 | return description;
34 | }
35 |
36 | /**
37 | * @param description
38 | * the description to set
39 | */
40 | public void setDescription(String description) {
41 | this.description = description;
42 | }
43 |
44 | /*
45 | * (non-Javadoc)
46 | *
47 | * @see java.lang.Object#toString()
48 | */
49 | @Override
50 | public String toString() {
51 | return "SnapshotForUpdate [name=" + name + ", description=" + description + "]";
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Snapshots.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Snapshots implements Iterable, Serializable {
10 |
11 | @JsonProperty("snapshots")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /*
22 | * (non-Javadoc)
23 | *
24 | * @see java.lang.Object#toString()
25 | */
26 | @Override
27 | public String toString() {
28 | return "Snapshots [list=" + list + "]";
29 | }
30 |
31 | @Override
32 | public Iterator iterator() {
33 | return list.iterator();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForExtend.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonProperty;
6 | import com.fasterxml.jackson.annotation.JsonRootName;
7 |
8 | @JsonRootName("os-extend")
9 | public class VolumeForExtend implements Serializable {
10 |
11 | @JsonProperty("new_size")
12 | private Integer size;
13 |
14 | /**
15 | * @return the size
16 | */
17 | public Integer getSize() {
18 | return size;
19 | }
20 |
21 | /**
22 | * @param size
23 | * the size to set
24 | */
25 | public void setSize(Integer size) {
26 | this.size = size;
27 | }
28 |
29 | /*
30 | * (non-Javadoc)
31 | *
32 | * @see java.lang.Object#toString()
33 | */
34 | @Override
35 | public String toString() {
36 | return "VolumeForExtend [size=" + size + "]";
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeForUpdate.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | @JsonRootName("volume")
8 | public class VolumeForUpdate implements Serializable {
9 |
10 | private String name;
11 |
12 | private String description;
13 |
14 | /**
15 | * @return the name
16 | */
17 | public String getName() {
18 | return name;
19 | }
20 |
21 | /**
22 | * @param name
23 | * the name to set
24 | */
25 | public void setName(String name) {
26 | this.name = name;
27 | }
28 |
29 | /**
30 | * @return the description
31 | */
32 | public String getDescription() {
33 | return description;
34 | }
35 |
36 | /**
37 | * @param description
38 | * the description to set
39 | */
40 | public void setDescription(String description) {
41 | this.description = description;
42 | }
43 |
44 | /*
45 | * (non-Javadoc)
46 | *
47 | * @see java.lang.Object#toString()
48 | */
49 | @Override
50 | public String toString() {
51 | return "VolumeForUpdate [name=" + name + ", description=" + description + "]";
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeType.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Map;
5 |
6 | import com.fasterxml.jackson.annotation.JsonProperty;
7 | import com.fasterxml.jackson.annotation.JsonRootName;
8 |
9 | @JsonRootName("volume_type")
10 | public class VolumeType implements Serializable {
11 |
12 | private String id;
13 |
14 | private String name;
15 |
16 | @JsonProperty("extra_specs")
17 | private Map extraSpecs;
18 |
19 | /**
20 | * @return the id
21 | */
22 | public String getId() {
23 | return id;
24 | }
25 |
26 | /**
27 | * @return the name
28 | */
29 | public String getName() {
30 | return name;
31 | }
32 |
33 | /**
34 | * @return the extra_specs
35 | */
36 | public Map getExtraSpecs() {
37 | return extraSpecs;
38 | }
39 |
40 | /*
41 | * (non-Javadoc)
42 | *
43 | * @see java.lang.Object#toString()
44 | */
45 | @Override
46 | public String toString() {
47 | return "VolumeType [id=" + id + ", name=" + name + ", extra_specs=" + extraSpecs + "]";
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeTypeForCreate.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Map;
5 |
6 | import com.fasterxml.jackson.annotation.JsonProperty;
7 | import com.fasterxml.jackson.annotation.JsonRootName;
8 |
9 | @JsonRootName("volume_type")
10 | public class VolumeTypeForCreate implements Serializable {
11 |
12 | private String name;
13 |
14 | @JsonProperty("extra_specs")
15 | private Map extraSpecs;
16 |
17 | /**
18 | * @return the name
19 | */
20 | public String getName() {
21 | return name;
22 | }
23 |
24 | /**
25 | * @param name
26 | * the name to set
27 | */
28 | public void setName(String name) {
29 | this.name = name;
30 | }
31 |
32 | /**
33 | * @return the extraSpecs
34 | */
35 | public Map getExtraSpecs() {
36 | return extraSpecs;
37 | }
38 |
39 | /**
40 | * @param extraSpecs
41 | * the extra_specs to set
42 | */
43 | public void setExtraSpecs(Map extraSpecs) {
44 | this.extraSpecs = extraSpecs;
45 | }
46 |
47 | /*
48 | * (non-Javadoc)
49 | *
50 | * @see java.lang.Object#toString()
51 | */
52 | @Override
53 | public String toString() {
54 | return "VolumeForCreate [name=" + name + ", metadata=" + extraSpecs + "]";
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/VolumeTypes.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class VolumeTypes implements Iterable, Serializable {
10 |
11 | @JsonProperty("volume_types")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /*
22 | * (non-Javadoc)
23 | *
24 | * @see java.lang.Object#toString()
25 | */
26 | @Override
27 | public String toString() {
28 | return "Volume Types [list=" + list + "]";
29 | }
30 |
31 | @Override
32 | public Iterator iterator() {
33 | return list.iterator();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/cinder-model/src/main/java/com/woorea/openstack/cinder/model/Volumes.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.cinder.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Volumes implements Iterable, Serializable {
10 |
11 | @JsonProperty("volumes")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /*
22 | * (non-Javadoc)
23 | *
24 | * @see java.lang.Object#toString()
25 | */
26 | @Override
27 | public String toString() {
28 | return "Volumes [list=" + list + "]";
29 | }
30 |
31 | @Override
32 | public Iterator iterator() {
33 | return list.iterator();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/glance-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | glance-client
9 | OpenStack Glance Client
10 | OpenStack Glance Client
11 |
12 |
13 | com.woorea
14 | openstack-client
15 | 3.2.10-SNAPSHOT
16 |
17 |
18 |
19 | com.woorea
20 | glance-model
21 | 3.2.10-SNAPSHOT
22 |
23 |
24 |
--------------------------------------------------------------------------------
/glance-client/src/main/java/com/woorea/openstack/glance/Glance.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.base.client.OpenStackClientConnector;
5 |
6 | public class Glance extends OpenStackClient {
7 |
8 | private final ImagesResource IMAGES;
9 |
10 | private final SharedImagesResource SHARED_IMAGES;
11 |
12 | public Glance(String endpoint, OpenStackClientConnector connector) {
13 | super(endpoint, connector);
14 | IMAGES = new ImagesResource(this);
15 | SHARED_IMAGES = new SharedImagesResource(this);
16 | }
17 |
18 | public Glance(String endpoint) {
19 | this(endpoint, null);
20 | }
21 |
22 | public final ImagesResource images() {
23 | return IMAGES;
24 | }
25 |
26 | public final SharedImagesResource sharedImages() {
27 | return SHARED_IMAGES;
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/glance-client/src/main/java/com/woorea/openstack/glance/SharedImagesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance;
2 |
3 |
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.glance.model.Images;
8 | import com.woorea.openstack.glance.model.SharedImages;
9 |
10 | public class SharedImagesResource {
11 |
12 | private final OpenStackClient CLIENT;
13 |
14 | public SharedImagesResource(OpenStackClient client) {
15 | CLIENT = client;
16 | }
17 |
18 | public List list(String tenantId, boolean detail) {
19 | return new List(tenantId, detail);
20 | }
21 |
22 | public class List extends OpenStackRequest {
23 |
24 | public List(String tenantId, boolean detail) {
25 | super(CLIENT, HttpMethod.GET, new StringBuffer(detail ? "/shared-images/detail" : "/shared-images/").append(tenantId).toString(), null, SharedImages.class);
26 | }
27 |
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/glance-client/src/main/java/com/woorea/openstack/glance/v2/Glance.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.v2;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.base.client.OpenStackClientConnector;
5 |
6 | public class Glance extends OpenStackClient {
7 |
8 | private final ImagesResource IMAGES;
9 |
10 | public Glance(String endpoint, OpenStackClientConnector connector) {
11 | super(endpoint, connector);
12 | IMAGES = new ImagesResource(this);
13 | }
14 |
15 | public Glance(String endpoint) {
16 | this(endpoint, null);
17 | }
18 |
19 | public final ImagesResource images() {
20 | return IMAGES;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/glance-model/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | glance-model
9 | OpenStack Glance Model
10 | OpenStack Glance Model
11 |
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageDownload.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model;
2 |
3 | import java.io.InputStream;
4 |
5 | public class ImageDownload {
6 |
7 | private Image image;
8 |
9 | private InputStream inputStream;
10 |
11 | /**
12 | * @return the image
13 | */
14 | public Image getImage() {
15 | return image;
16 | }
17 |
18 | /**
19 | * @param image the image to set
20 | */
21 | public void setImage(Image image) {
22 | this.image = image;
23 | }
24 |
25 | /**
26 | * @return the inputStream
27 | */
28 | public InputStream getInputStream() {
29 | return inputStream;
30 | }
31 |
32 | /**
33 | * @param inputStream the inputStream to set
34 | */
35 | public void setInputStream(InputStream inputStream) {
36 | this.inputStream = inputStream;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageMember.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonProperty;
6 |
7 | public class ImageMember implements Serializable {
8 |
9 | @JsonProperty("can_share")
10 | private boolean canShare;
11 |
12 | @JsonProperty("member_id")
13 | private String memberId;
14 |
15 | public ImageMember() {
16 |
17 | }
18 |
19 | public ImageMember(boolean canShare, String memberId) {
20 | this.canShare = canShare;
21 | this.memberId = memberId;
22 | }
23 |
24 | /**
25 | * @return the canShare
26 | */
27 | public boolean isCanShare() {
28 | return canShare;
29 | }
30 |
31 | /**
32 | * @param canShare the canShare to set
33 | */
34 | public void setCanShare(boolean canShare) {
35 | this.canShare = canShare;
36 | }
37 |
38 | /**
39 | * @return the memberId
40 | */
41 | public String getMemberId() {
42 | return memberId;
43 | }
44 |
45 | /**
46 | * @param memberId the memberId to set
47 | */
48 | public void setMemberId(String memberId) {
49 | this.memberId = memberId;
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageMembers.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class ImageMembers implements Iterable, Serializable {
10 |
11 | @JsonProperty("members")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/ImageUpload.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model;
2 |
3 | import java.io.InputStream;
4 | import java.util.HashMap;
5 | import java.util.Map;
6 |
7 | public class ImageUpload {
8 |
9 | private Image image;
10 |
11 | private String store;
12 |
13 | private Map properties;
14 |
15 | private InputStream inputStream;
16 |
17 | public ImageUpload(Image image) {
18 | setImage(image);
19 | }
20 |
21 | public Image getImage() {
22 | return image;
23 | }
24 |
25 | public void setImage(Image image) {
26 | this.image = image;
27 | }
28 |
29 | /**
30 | * @return the store
31 | */
32 | public String getStore() {
33 | return store;
34 | }
35 |
36 | /**
37 | * @param store the store to set
38 | */
39 | public void setStore(String store) {
40 | this.store = store;
41 | }
42 |
43 | /**
44 | * @return the properties
45 | */
46 | public Map getProperties() {
47 | if(properties == null) {
48 | properties = new HashMap();
49 | }
50 | return properties;
51 | }
52 |
53 | /**
54 | * @return the inputStream
55 | */
56 | public InputStream getInputStream() {
57 | return inputStream;
58 | }
59 |
60 | /**
61 | * @param inputStream the inputStream to set
62 | */
63 | public void setInputStream(InputStream inputStream) {
64 | this.inputStream = inputStream;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/Images.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Images implements Iterable, Serializable {
10 |
11 | @JsonProperty("images")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/SharedImage.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model;
2 |
3 | public class SharedImage {
4 |
5 | }
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/SharedImages.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class SharedImages implements Iterable, Serializable {
10 |
11 | @JsonProperty("shared_images")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | }
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/ImageDownload.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model.v2;
2 |
3 | import java.io.InputStream;
4 |
5 | public class ImageDownload {
6 |
7 | private InputStream inputStream;
8 |
9 | /**
10 | * @return the inputStream
11 | */
12 | public InputStream getInputStream() {
13 | return inputStream;
14 | }
15 |
16 | /**
17 | * @param inputStream the inputStream to set
18 | */
19 | public void setInputStream(InputStream inputStream) {
20 | this.inputStream = inputStream;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/glance-model/src/main/java/com/woorea/openstack/glance/model/v2/Images.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.glance.model.v2;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | import java.io.Serializable;
6 | import java.util.Iterator;
7 | import java.util.List;
8 |
9 | public class Images implements Iterable, Serializable {
10 |
11 | @JsonProperty("images")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/heat-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | heat-client
9 | OpenStack Heat Client
10 | OpenStack Heat Client
11 |
12 |
13 | com.woorea
14 | openstack-client
15 | 3.2.10-SNAPSHOT
16 |
17 |
18 |
19 | com.woorea
20 | heat-model
21 | 3.2.10-SNAPSHOT
22 |
23 |
24 |
--------------------------------------------------------------------------------
/heat-client/src/main/java/com/woorea/openstack/heat/Heat.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.heat;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.base.client.OpenStackClientConnector;
5 |
6 | /**
7 | * Reference: http://api.openstack.org/api-ref-orchestration.html
8 | */
9 | public class Heat extends OpenStackClient {
10 |
11 | private final StackResource stacks;
12 | private final ResourcesResource resources;
13 |
14 | public Heat(String endpoint, OpenStackClientConnector connector) {
15 | super(endpoint, connector);
16 | stacks = new StackResource(this);
17 | resources = new ResourcesResource(this);
18 | }
19 |
20 | public Heat(String endpoint) {
21 | this(endpoint, null);
22 | }
23 |
24 | public StackResource getStacks() {
25 | return stacks;
26 | }
27 |
28 | public ResourcesResource getResources() {
29 | return resources;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/heat-client/src/main/java/com/woorea/openstack/heat/ResourcesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.heat;
2 |
3 | import com.woorea.openstack.base.client.HttpMethod;
4 | import com.woorea.openstack.base.client.OpenStackClient;
5 | import com.woorea.openstack.base.client.OpenStackRequest;
6 | import com.woorea.openstack.heat.model.Resources;
7 |
8 |
9 | /**
10 | * v1/{tenant_id}/stacks/{stack_name}/resources
11 | */
12 | public class ResourcesResource {
13 | private final OpenStackClient client;
14 |
15 | public ResourcesResource(OpenStackClient client) {
16 | this.client = client;
17 | }
18 |
19 | public ListResources listResources(String name) {
20 | return new ListResources(name);
21 | }
22 |
23 | /**
24 | * v1/{tenant_id}/stacks/{stack_name}/resources
25 | */
26 | public class ListResources extends OpenStackRequest {
27 | public ListResources(String name) {
28 | super(client, HttpMethod.GET, "/stacks/" + name + "/resources", null, Resources.class);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/heat-model/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | heat-model
9 | OpenStack Heat Model
10 | OpenStack Heat Model
11 |
--------------------------------------------------------------------------------
/heat-model/src/main/java/com/woorea/openstack/heat/model/Explanation.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.heat.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import com.fasterxml.jackson.annotation.JsonRootName;
5 |
6 | @JsonRootName("error")
7 | public class Explanation {
8 | @JsonProperty("explanation")
9 | private String explanation;
10 |
11 | @JsonProperty("code")
12 | private int code;
13 |
14 | @JsonRootName("error")
15 | public static class Error {
16 | @JsonProperty("message")
17 | private String message;
18 |
19 | @JsonProperty("traceback")
20 | private String traceback;
21 |
22 | @JsonProperty("type")
23 | private String type;
24 |
25 | @JsonProperty("title")
26 | private String title;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/heat-model/src/main/java/com/woorea/openstack/heat/model/Link.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.heat.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | public class Link {
6 | @JsonProperty("href")
7 | private String href;
8 |
9 | @JsonProperty("rel")
10 | private String rel;
11 |
12 | public String getHref() {
13 | return href;
14 | }
15 |
16 | public void setHref(String href) {
17 | this.href = href;
18 | }
19 |
20 | public String getRel() {
21 | return rel;
22 | }
23 |
24 | public void setRel(String rel) {
25 | this.rel = rel;
26 | }
27 |
28 | @Override
29 | public String toString() {
30 | return "Link{" +
31 | "href='" + href + '\'' +
32 | ", rel='" + rel + '\'' +
33 | '}';
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/heat-model/src/main/java/com/woorea/openstack/heat/model/Resources.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.heat.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | import java.io.Serializable;
6 | import java.util.Iterator;
7 | import java.util.List;
8 |
9 | public class Resources implements Iterable, Serializable {
10 | @JsonProperty("resources")
11 | private List list;
12 |
13 | public List getList() {
14 | return list;
15 | }
16 |
17 | @Override
18 | public Iterator iterator() {
19 | return list.iterator();
20 | }
21 |
22 | @Override
23 | public String toString() {
24 | return "Resources{" +
25 | "list=" + list +
26 | '}';
27 | }
28 | }
--------------------------------------------------------------------------------
/heat-model/src/main/java/com/woorea/openstack/heat/model/Stacks.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.heat.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 |
5 | import java.io.Serializable;
6 | import java.util.Iterator;
7 | import java.util.List;
8 |
9 | public class Stacks implements Iterable, Serializable {
10 | @JsonProperty("stacks")
11 | private List list;
12 |
13 | @Override
14 | public Iterator iterator() {
15 | return list.iterator();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/keystone-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | keystone-client
9 | OpenStack Keystone Client
10 | OpenStack Keystone Client
11 |
12 |
13 | com.woorea
14 | openstack-client
15 | 3.2.10-SNAPSHOT
16 |
17 |
18 | com.woorea
19 | keystone-model
20 | 3.2.10-SNAPSHOT
21 |
22 |
23 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/api/RolesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.api;
2 |
3 |
4 | import com.woorea.openstack.base.client.Entity;
5 | import com.woorea.openstack.base.client.HttpMethod;
6 | import com.woorea.openstack.base.client.OpenStackClient;
7 | import com.woorea.openstack.base.client.OpenStackRequest;
8 | import com.woorea.openstack.keystone.model.Role;
9 | import com.woorea.openstack.keystone.model.Roles;
10 |
11 | public class RolesResource {
12 |
13 | private OpenStackClient client;
14 |
15 | public RolesResource(OpenStackClient client) {
16 | this.client = client;
17 | }
18 |
19 | public List list() {
20 | return new List();
21 | }
22 |
23 | public Create create(Role role) {
24 | return new Create(role);
25 | }
26 |
27 | public Delete delete(String id) {
28 | return new Delete(id);
29 | }
30 |
31 | public class List extends OpenStackRequest {
32 |
33 | public List() {
34 | super(client, HttpMethod.GET, "/OS-KSADM/roles", null, Roles.class);
35 | }
36 |
37 | }
38 |
39 | public class Create extends OpenStackRequest {
40 |
41 | private Role role;
42 |
43 | public Create(Role role) {
44 | super(client, HttpMethod.POST, "/OS-KSADM/roles", Entity.json(role), Role.class);
45 | this.role = role;
46 | }
47 |
48 | }
49 |
50 | public class Delete extends OpenStackRequest {
51 |
52 | public Delete(String id) {
53 | super(client, HttpMethod.DELETE, new StringBuilder("/OS-KSADM/roles/").append(id).toString(), null, Void.class);
54 | }
55 |
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneUtils.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.utils;
2 |
3 | import java.util.List;
4 |
5 | import com.woorea.openstack.keystone.model.Access.Service;
6 |
7 | public class KeystoneUtils {
8 |
9 | public static String findEndpointURL(List serviceCatalog, String type, String region, String facing) {
10 | for(Service service : serviceCatalog) {
11 | if(type.equals(service.getType())) {
12 | for(Service.Endpoint endpoint : service.getEndpoints()) {
13 | if(region == null || region.equals(endpoint.getRegion())) {
14 | if(endpoint.getPublicURL() != null && facing.equals("public")) {
15 | return endpoint.getPublicURL();
16 | } else if(endpoint.getInternalURL() != null && facing.equals("internal")) {
17 | return endpoint.getInternalURL();
18 | } else if(endpoint.getAdminURL() != null && facing.equals("admin")) {
19 | return endpoint.getAdminURL();
20 | }
21 | }
22 | }
23 | }
24 | }
25 | throw new RuntimeException("endpoint url not found");
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/CredentialsResources.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.keystone.v3.model.Credential;
5 | import com.woorea.openstack.keystone.v3.model.Credentials;
6 |
7 | public class CredentialsResources extends GenericResource {
8 |
9 | public CredentialsResources(OpenStackClient client) {
10 | super(client, "/credentials", Credential.class, Credentials.class);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainGroupRolesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.keystone.v3.model.Role;
5 | import com.woorea.openstack.keystone.v3.model.Roles;
6 |
7 | public class DomainGroupRolesResource extends GenericResource {
8 |
9 | public DomainGroupRolesResource(OpenStackClient client, String path) {
10 | super(client, path, Role.class, Roles.class);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.Entity;
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.keystone.model.Role;
8 | import com.woorea.openstack.keystone.model.Roles;
9 |
10 | public class DomainUserRolesResource extends GenericResource {
11 |
12 | public DomainUserRolesResource(OpenStackClient client, String path) {
13 | super(client, path, Role.class, Roles.class);
14 | }
15 |
16 | public OpenStackRequest add(String roleId) {
17 | return new OpenStackRequest(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class);
18 | }
19 |
20 | public OpenStackRequest remove(String roleId) {
21 | return new OpenStackRequest(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.keystone.v3.model.Domain;
5 | import com.woorea.openstack.keystone.v3.model.Domains;
6 |
7 | public class DomainsResource extends GenericResource {
8 |
9 | public DomainsResource(OpenStackClient client) {
10 | super(client, "/domains", Domain.class, Domains.class);
11 | }
12 |
13 | public DomainUserRolesResource userRoles(String domainId, String userId) {
14 | return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString());
15 | }
16 |
17 | public DomainUserRolesResource groupRoles(String domainId, String groupId) {
18 | return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/groups/").append(groupId).append("/roles").toString());
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/EndpointsResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.keystone.v3.model.Endpoint;
5 | import com.woorea.openstack.keystone.v3.model.Endpoints;
6 |
7 | public class EndpointsResource extends GenericResource {
8 |
9 | public EndpointsResource(OpenStackClient client) {
10 | super(client, "/endpoints", Endpoint.class, Endpoints.class);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupUsersResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.keystone.v3.model.User;
5 | import com.woorea.openstack.keystone.v3.model.Users;
6 |
7 |
8 | public class GroupUsersResource extends GenericResource {
9 |
10 | public GroupUsersResource(OpenStackClient client, String path) {
11 | super(client, path, User.class, Users.class);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.keystone.v3.model.Group;
5 | import com.woorea.openstack.keystone.v3.model.Groups;
6 |
7 | public class GroupsResource extends GenericResource {
8 |
9 | public GroupsResource(OpenStackClient client) {
10 | super(client, "/groups", Group.class, Groups.class);
11 | }
12 |
13 | public DomainUserRolesResource userRoles(String domainId, String userId) {
14 | return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString());
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/PoliciesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.keystone.model.Role;
5 | import com.woorea.openstack.keystone.model.Roles;
6 | import com.woorea.openstack.keystone.v3.model.Policies;
7 | import com.woorea.openstack.keystone.v3.model.Policy;
8 |
9 | public class PoliciesResource extends GenericResource {
10 |
11 | public PoliciesResource(OpenStackClient client) {
12 | super(client, "/policies", Policy.class, Policies.class);
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectGroupRolesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.base.client.OpenStackRequest;
5 | import com.woorea.openstack.keystone.model.Role;
6 | import com.woorea.openstack.keystone.model.Roles;
7 |
8 | public class ProjectGroupRolesResource extends GenericResource {
9 |
10 | public ProjectGroupRolesResource(OpenStackClient client, String path) {
11 | super(client, path, Role.class, Roles.class);
12 | }
13 |
14 | @Override
15 | public OpenStackRequest create(Role one) {
16 | throw new UnsupportedOperationException();
17 | }
18 |
19 | @Override
20 | public OpenStackRequest show(String id) {
21 | throw new UnsupportedOperationException();
22 | }
23 |
24 | @Override
25 | public OpenStackRequest update(String id, Role one) {
26 | throw new UnsupportedOperationException();
27 | }
28 |
29 | @Override
30 | public OpenStackRequest delete(String id) {
31 | throw new UnsupportedOperationException();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.Entity;
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 |
8 | public class ProjectRolesResource {
9 |
10 | private final OpenStackClient CLIENT;
11 |
12 | private final String PATH;
13 |
14 | public ProjectRolesResource(OpenStackClient client, String path) {
15 | this.CLIENT = client;
16 | this.PATH = path;
17 | }
18 |
19 | public OpenStackRequest add(String roleId) {
20 | return new OpenStackRequest(CLIENT, HttpMethod.PUT, new StringBuilder(PATH).append("/").append(roleId).toString(), Entity.json(""), Void.class);
21 | }
22 |
23 | public OpenStackRequest remove(String roleId) {
24 | return new OpenStackRequest(CLIENT, HttpMethod.DELETE, new StringBuilder(PATH).append("/").append(roleId).toString(), null, Void.class);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.Entity;
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.keystone.model.Role;
8 | import com.woorea.openstack.keystone.model.Roles;
9 |
10 | public class ProjectUserRolesResource extends GenericResource {
11 |
12 | public ProjectUserRolesResource(OpenStackClient client, String path) {
13 | super(client, path, Role.class, Roles.class);
14 | }
15 |
16 | public OpenStackRequest add(String roleId) {
17 | return new OpenStackRequest(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class);
18 | }
19 |
20 | public OpenStackRequest remove(String roleId) {
21 | return new OpenStackRequest(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.base.client.OpenStackRequest;
5 | import com.woorea.openstack.keystone.model.Users;
6 | import com.woorea.openstack.keystone.v3.model.Project;
7 | import com.woorea.openstack.keystone.v3.model.Projects;
8 |
9 | public class ProjectsResource extends GenericResource {
10 |
11 | public ProjectsResource(OpenStackClient client) {
12 | super(client, "/projects", Project.class, Projects.class);
13 | }
14 |
15 | public OpenStackRequest users(String projectId) {
16 | return CLIENT.get(new StringBuilder(path).append("/").append(projectId).append("/users/").toString(), Users.class);
17 | }
18 |
19 | public ProjectUserRolesResource userRoles(String projectId, String userId) {
20 | return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/users/").append(userId).append("/roles").toString());
21 | }
22 |
23 | public ProjectUserRolesResource groupRoles(String projectId, String groupId) {
24 | return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/groups/").append(groupId).append("/roles").toString());
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.base.client.OpenStackRequest;
5 | import com.woorea.openstack.keystone.v3.model.Role;
6 | import com.woorea.openstack.keystone.v3.model.Roles;
7 | import com.woorea.openstack.keystone.v3.model.Users;
8 |
9 | public class RolesResource extends GenericResource {
10 |
11 | public RolesResource(OpenStackClient client) {
12 | super(client, "/roles", Role.class, Roles.class);
13 | }
14 |
15 | public OpenStackRequest users(String domainId, String userId) {
16 | return CLIENT.get(new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString(), Users.class);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ServicesResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.keystone.model.Service;
5 | import com.woorea.openstack.keystone.model.Services;
6 |
7 | public class ServicesResource extends GenericResource {
8 |
9 | public ServicesResource(OpenStackClient client) {
10 | super(client, "/services", Service.class, Services.class);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.Entity;
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.keystone.v3.model.Authentication;
8 | import com.woorea.openstack.keystone.v3.model.Token;
9 |
10 | public class TokensResource {
11 |
12 | private final OpenStackClient CLIENT;
13 |
14 | public TokensResource(OpenStackClient client) {
15 | CLIENT = client;
16 | }
17 |
18 | public Authenticate authenticate(Authentication authentication) {
19 | return new Authenticate(authentication);
20 | }
21 |
22 | public OpenStackRequest show() {
23 | return CLIENT.get("/auth/tokens", Token.class);
24 | }
25 |
26 | public class Authenticate extends OpenStackRequest {
27 |
28 | private Authentication authentication;
29 |
30 | public Authenticate() {
31 |
32 | }
33 |
34 | public Authenticate(Authentication authentication) {
35 | super(CLIENT, HttpMethod.POST, "/auth/tokens", Entity.json(authentication), Token.class);
36 | this.authentication = authentication;
37 | }
38 |
39 | }
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.api;
2 |
3 | import com.woorea.openstack.base.client.OpenStackClient;
4 | import com.woorea.openstack.base.client.OpenStackRequest;
5 | import com.woorea.openstack.keystone.model.Services;
6 | import com.woorea.openstack.keystone.v3.model.User;
7 | import com.woorea.openstack.keystone.v3.model.Users;
8 |
9 | public class UsersResource extends GenericResource {
10 |
11 | public UsersResource(OpenStackClient client) {
12 | super(client, "/users", User.class, Users.class);
13 | }
14 |
15 | public OpenStackRequest groups(String userId) {
16 | return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/groups").toString(), Services.class);
17 | }
18 |
19 | public OpenStackRequest projects(String userId) {
20 | return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/projects").toString(), Services.class);
21 | }
22 |
23 | public OpenStackRequest roles(String userId) {
24 | return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/roles").toString(), Services.class);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/keystone-model/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | keystone-model
9 | OpenStack Keystone Model
10 | OpenStack Keystone Model
11 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Authentication.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | public abstract class Authentication implements Serializable {
8 |
9 | private String tenantId;
10 |
11 | private String tenantName;
12 |
13 | /**
14 | * @return the tenantId
15 | */
16 | public String getTenantId() {
17 | return tenantId;
18 | }
19 |
20 | /**
21 | * @param tenantId the tenantId to set
22 | */
23 | public void setTenantId(String tenantId) {
24 | this.tenantId = tenantId;
25 | }
26 |
27 | /**
28 | * @return the tenantName
29 | */
30 | public String getTenantName() {
31 | return tenantName;
32 | }
33 |
34 | /**
35 | * @param tenantName the tenantName to set
36 | */
37 | public void setTenantName(String tenantName) {
38 | this.tenantName = tenantName;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Endpoints.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Endpoints implements Iterable, Serializable {
10 |
11 | @JsonProperty("endpoints")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Endpoints [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Error.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | @JsonRootName("error")
8 | public class Error implements Serializable {
9 |
10 | private Integer code;
11 |
12 | private String title;
13 |
14 | private String message;
15 |
16 | /**
17 | * @return the code
18 | */
19 | public Integer getCode() {
20 | return code;
21 | }
22 |
23 | /**
24 | * @return the title
25 | */
26 | public String getTitle() {
27 | return title;
28 | }
29 |
30 | /**
31 | * @return the message
32 | */
33 | public String getMessage() {
34 | return message;
35 | }
36 |
37 | /* (non-Javadoc)
38 | * @see java.lang.Object#toString()
39 | */
40 | @Override
41 | public String toString() {
42 | return "Error [code=" + code + ", title=" + title + ", message="
43 | + message + "]";
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Link.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 |
5 | public class Link implements Serializable {
6 |
7 | private String rel;
8 |
9 | private String href;
10 |
11 | private String type;
12 |
13 | /**
14 | * @return the rel
15 | */
16 | public String getRel() {
17 | return rel;
18 | }
19 |
20 | /**
21 | * @return the href
22 | */
23 | public String getHref() {
24 | return href;
25 | }
26 |
27 | /**
28 | * @return the type
29 | */
30 | public String getType() {
31 | return type;
32 | }
33 |
34 | /* (non-Javadoc)
35 | * @see java.lang.Object#toString()
36 | */
37 | @Override
38 | public String toString() {
39 | return "Link [rel=" + rel + ", href=" + href + ", type=" + type + "]";
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Role.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | @JsonRootName("role")
8 | public class Role implements Serializable {
9 |
10 | private String id;
11 |
12 | private String name;
13 |
14 | private String description;
15 |
16 | private String enabled;
17 |
18 | /**
19 | * @return the id
20 | */
21 | public String getId() {
22 | return id;
23 | }
24 |
25 | /**
26 | * @return the name
27 | */
28 | public String getName() {
29 | return name;
30 | }
31 |
32 | /**
33 | * @param name the name to set
34 | */
35 | public void setName(String name) {
36 | this.name = name;
37 | }
38 |
39 | /**
40 | * @return the description
41 | */
42 | public String getDescription() {
43 | return description;
44 | }
45 |
46 | /**
47 | * @param description the description to set
48 | */
49 | public void setDescription(String description) {
50 | this.description = description;
51 | }
52 |
53 | /**
54 | * @return the enabled
55 | */
56 | public String getEnabled() {
57 | return enabled;
58 | }
59 |
60 | /**
61 | * @param enabled the enabled to set
62 | */
63 | public void setEnabled(String enabled) {
64 | this.enabled = enabled;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Roles.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Roles implements Iterable, Serializable {
10 |
11 | @JsonProperty("roles")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Roles [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Service.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | @JsonRootName("OS-KSADM:service")
8 | public class Service implements Serializable {
9 |
10 | private String id;
11 |
12 | private String type;
13 |
14 | private String name;
15 |
16 | private String description;
17 |
18 | /**
19 | * @return the id
20 | */
21 | public String getId() {
22 | return id;
23 | }
24 |
25 | /**
26 | * @return the type
27 | */
28 | public String getType() {
29 | return type;
30 | }
31 |
32 | /**
33 | * @param type the type to set
34 | */
35 | public void setType(String type) {
36 | this.type = type;
37 | }
38 |
39 | /**
40 | * @return the name
41 | */
42 | public String getName() {
43 | return name;
44 | }
45 |
46 | /**
47 | * @param name the name to set
48 | */
49 | public void setName(String name) {
50 | this.name = name;
51 | }
52 |
53 | /**
54 | * @return the description
55 | */
56 | public String getDescription() {
57 | return description;
58 | }
59 |
60 | /**
61 | * @param description the description to set
62 | */
63 | public void setDescription(String description) {
64 | this.description = description;
65 | }
66 |
67 | /* (non-Javadoc)
68 | * @see java.lang.Object#toString()
69 | */
70 | @Override
71 | public String toString() {
72 | return "Service [id=" + id + ", type=" + type + ", name=" + name
73 | + ", description=" + description + "]";
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Services.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Services implements Iterable, Serializable {
10 |
11 | @JsonProperty("OS-KSADM:services")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Services [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Tenants.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Tenants implements Iterable, Serializable {
10 |
11 | @JsonProperty("tenants")
12 | private List list;
13 |
14 | @JsonProperty("tenants_links")
15 | private List links;
16 |
17 | /**
18 | * @return the list
19 | */
20 | public List getList() {
21 | return list;
22 | }
23 |
24 | /**
25 | * @return the links
26 | */
27 | public List getLinks() {
28 | return links;
29 | }
30 |
31 | /* (non-Javadoc)
32 | * @see java.lang.Object#toString()
33 | */
34 | @Override
35 | public String toString() {
36 | return "Tenants [list=" + list + ", links=" + links + "]";
37 | }
38 |
39 | @Override
40 | public Iterator iterator() {
41 | return list.iterator();
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Token.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4 |
5 | import java.util.Calendar;
6 |
7 | @JsonIgnoreProperties(ignoreUnknown=true)
8 | public final class Token {
9 |
10 | private String id;
11 |
12 | private Calendar issued_at;
13 |
14 | private Calendar expires;
15 |
16 | private Tenant tenant;
17 |
18 | /**
19 | * @return the id
20 | */
21 | public String getId() {
22 | return id;
23 | }
24 |
25 | /**
26 | * @return the issued_at
27 | */
28 | public Calendar getIssued_at() {
29 | return issued_at;
30 | }
31 |
32 | /**
33 | * @return the expires
34 | */
35 | public Calendar getExpires() {
36 | return expires;
37 | }
38 |
39 | /**
40 | * @return the tenant
41 | */
42 | public Tenant getTenant() {
43 | return tenant;
44 | }
45 |
46 | /* (non-Javadoc)
47 | * @see java.lang.Object#toString()
48 | */
49 | @Override
50 | public String toString() {
51 | return "Token [id=" + id + ", Issued_at=" + issued_at + ", expires=" + expires + ", tenant="
52 | + tenant + "]";
53 | }
54 |
55 | }
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/Users.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Users implements Iterable, Serializable {
10 |
11 | @JsonProperty("users")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Users [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/model/authentication/TokenAuthentication.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.model.authentication;
2 |
3 | import com.fasterxml.jackson.annotation.JsonRootName;
4 |
5 | import com.woorea.openstack.keystone.model.Authentication;
6 |
7 | @JsonRootName("auth")
8 | public class TokenAuthentication extends Authentication {
9 |
10 | public static final class Token {
11 |
12 | private String id;
13 |
14 | /**
15 | * @return the id
16 | */
17 | public String getId() {
18 | return id;
19 | }
20 |
21 | /**
22 | * @param id the id to set
23 | */
24 | public void setId(String id) {
25 | this.id = id;
26 | }
27 |
28 | }
29 |
30 | private Token token = new Token();
31 |
32 | public TokenAuthentication(String token) {
33 | this.token.id = token;
34 | }
35 |
36 | /**
37 | * @return the token
38 | */
39 | public Token getToken() {
40 | return token;
41 | }
42 |
43 | /**
44 | * @param token the token to set
45 | */
46 | public void setToken(Token token) {
47 | this.token = token;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credential.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import com.fasterxml.jackson.annotation.JsonRootName;
7 |
8 | @JsonRootName("credential")
9 | public class Credential {
10 |
11 | private String id;
12 |
13 | private String projectId;
14 |
15 | private String type;
16 |
17 | private String userId;
18 |
19 | private Map blob = new HashMap();
20 |
21 | public String getId() {
22 | return id;
23 | }
24 |
25 | public void setId(String id) {
26 | this.id = id;
27 | }
28 |
29 | public String getProjectId() {
30 | return projectId;
31 | }
32 |
33 | public void setProjectId(String projectId) {
34 | this.projectId = projectId;
35 | }
36 |
37 | public String getType() {
38 | return type;
39 | }
40 |
41 | public void setType(String type) {
42 | this.type = type;
43 | }
44 |
45 | public String getUserId() {
46 | return userId;
47 | }
48 |
49 | public void setUserId(String userId) {
50 | this.userId = userId;
51 | }
52 |
53 | public Map getBlob() {
54 | return blob;
55 | }
56 |
57 | public void setBlob(Map blob) {
58 | this.blob = blob;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Credentials.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Credentials implements Iterable, Serializable {
10 |
11 | @JsonProperty("credentials")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Credentials [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domain.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonRootName;
4 |
5 | @JsonRootName("domain")
6 | public class Domain {
7 |
8 | private String id;
9 |
10 | private String name;
11 |
12 | private String description;
13 |
14 | private Boolean enabled;
15 |
16 | public String getId() {
17 | return id;
18 | }
19 |
20 | public void setId(String id) {
21 | this.id = id;
22 | }
23 |
24 | public String getName() {
25 | return name;
26 | }
27 |
28 | public void setName(String name) {
29 | this.name = name;
30 | }
31 |
32 | public String getDescription() {
33 | return description;
34 | }
35 |
36 | public void setDescription(String description) {
37 | this.description = description;
38 | }
39 |
40 | public Boolean getEnabled() {
41 | return enabled;
42 | }
43 |
44 | public void setEnabled(Boolean enabled) {
45 | this.enabled = enabled;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Domains.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Domains implements Iterable, Serializable {
10 |
11 | @JsonProperty("domains")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Domains [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoint.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import com.fasterxml.jackson.annotation.JsonRootName;
5 |
6 | @JsonRootName("endpoint")
7 | public class Endpoint {
8 |
9 | private String id;
10 |
11 | @JsonProperty("interface")
12 | private String iface;
13 |
14 | private String name;
15 |
16 | @JsonProperty("service_id")
17 | private String serviceId;
18 |
19 | public String getId() {
20 | return id;
21 | }
22 |
23 | public void setId(String id) {
24 | this.id = id;
25 | }
26 |
27 | public String getInterface() {
28 | return iface;
29 | }
30 |
31 | public void setInterface(String iface) {
32 | this.iface = iface;
33 | }
34 |
35 | public String getName() {
36 | return name;
37 | }
38 |
39 | public void setName(String name) {
40 | this.name = name;
41 | }
42 |
43 | public String getServiceId() {
44 | return serviceId;
45 | }
46 |
47 | public void setServiceId(String serviceId) {
48 | this.serviceId = serviceId;
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Endpoints.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Endpoints implements Iterable, Serializable {
10 |
11 | @JsonProperty("endpoints")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Endpoints [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Group.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import com.fasterxml.jackson.annotation.JsonRootName;
5 |
6 | @JsonRootName("group")
7 | public class Group {
8 |
9 | private String id;
10 |
11 | @JsonProperty("domain_id")
12 | private String domainId;
13 |
14 | private String name;
15 |
16 | private String description;
17 |
18 | public String getId() {
19 | return id;
20 | }
21 |
22 | public void setId(String id) {
23 | this.id = id;
24 | }
25 |
26 | public String getDomainId() {
27 | return domainId;
28 | }
29 |
30 | public void setDomainId(String domainId) {
31 | this.domainId = domainId;
32 | }
33 |
34 | public String getName() {
35 | return name;
36 | }
37 |
38 | public void setName(String name) {
39 | this.name = name;
40 | }
41 |
42 | public String getDescription() {
43 | return description;
44 | }
45 |
46 | public void setDescription(String description) {
47 | this.description = description;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Groups.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Groups implements Iterable, Serializable {
10 |
11 | @JsonProperty("groups")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Groups [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policies.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Policies implements Iterable, Serializable {
10 |
11 | @JsonProperty("policies")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Policies [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Policy.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import com.fasterxml.jackson.annotation.JsonRootName;
7 |
8 | @JsonRootName("policy")
9 | public class Policy {
10 |
11 | private String id;
12 |
13 | private String projectId;
14 |
15 | private String type;
16 |
17 | private String userId;
18 |
19 | private Map blob = new HashMap();
20 |
21 | public String getId() {
22 | return id;
23 | }
24 |
25 | public void setId(String id) {
26 | this.id = id;
27 | }
28 |
29 | public String getProjectId() {
30 | return projectId;
31 | }
32 |
33 | public void setProjectId(String projectId) {
34 | this.projectId = projectId;
35 | }
36 |
37 | public String getType() {
38 | return type;
39 | }
40 |
41 | public void setType(String type) {
42 | this.type = type;
43 | }
44 |
45 | public String getUserId() {
46 | return userId;
47 | }
48 |
49 | public void setUserId(String userId) {
50 | this.userId = userId;
51 | }
52 |
53 | public Map getBlob() {
54 | return blob;
55 | }
56 |
57 | public void setBlob(Map blob) {
58 | this.blob = blob;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Project.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import com.fasterxml.jackson.annotation.JsonRootName;
5 |
6 | @JsonRootName("project")
7 | public class Project {
8 |
9 | private String id;
10 |
11 | @JsonProperty("domain_id")
12 | private String domainId;
13 |
14 | private String name;
15 |
16 | private Boolean enabled;
17 |
18 | public String getId() {
19 | return id;
20 | }
21 |
22 | public void setId(String id) {
23 | this.id = id;
24 | }
25 |
26 | public String getDomainId() {
27 | return domainId;
28 | }
29 |
30 | public void setDomainId(String domainId) {
31 | this.domainId = domainId;
32 | }
33 |
34 | public String getName() {
35 | return name;
36 | }
37 |
38 | public void setName(String name) {
39 | this.name = name;
40 | }
41 |
42 | public Boolean getEnabled() {
43 | return enabled;
44 | }
45 |
46 | public void setEnabled(Boolean enabled) {
47 | this.enabled = enabled;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Projects.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Projects implements Iterable, Serializable {
10 |
11 | @JsonProperty("projects")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Projects [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Role.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | @JsonRootName("role")
8 | public class Role implements Serializable {
9 |
10 | private String id;
11 |
12 | private String name;
13 |
14 | private String description;
15 |
16 | private String enabled;
17 |
18 | /**
19 | * @return the id
20 | */
21 | public String getId() {
22 | return id;
23 | }
24 |
25 | /**
26 | * @return the name
27 | */
28 | public String getName() {
29 | return name;
30 | }
31 |
32 | /**
33 | * @param name the name to set
34 | */
35 | public void setName(String name) {
36 | this.name = name;
37 | }
38 |
39 | /**
40 | * @return the description
41 | */
42 | public String getDescription() {
43 | return description;
44 | }
45 |
46 | /**
47 | * @param description the description to set
48 | */
49 | public void setDescription(String description) {
50 | this.description = description;
51 | }
52 |
53 | /**
54 | * @return the enabled
55 | */
56 | public String getEnabled() {
57 | return enabled;
58 | }
59 |
60 | /**
61 | * @param enabled the enabled to set
62 | */
63 | public void setEnabled(String enabled) {
64 | this.enabled = enabled;
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Roles.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Roles implements Iterable, Serializable {
10 |
11 | @JsonProperty("roles")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Roles [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Service.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonRootName;
4 |
5 | @JsonRootName("service")
6 | public class Service {
7 |
8 | private String id;
9 |
10 | private String type;
11 |
12 | private String name;
13 |
14 | private String description;
15 |
16 | public String getId() {
17 | return id;
18 | }
19 |
20 | public void setId(String id) {
21 | this.id = id;
22 | }
23 |
24 | public String getType() {
25 | return type;
26 | }
27 |
28 | public void setType(String type) {
29 | this.type = type;
30 | }
31 |
32 | public String getName() {
33 | return name;
34 | }
35 |
36 | public void setName(String name) {
37 | this.name = name;
38 | }
39 |
40 | public String getDescription() {
41 | return description;
42 | }
43 |
44 | public void setDescription(String description) {
45 | this.description = description;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Services.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | import com.woorea.openstack.keystone.model.Service;
10 |
11 | public class Services implements Iterable, Serializable {
12 |
13 | @JsonProperty("services")
14 | private List list;
15 |
16 | /**
17 | * @return the list
18 | */
19 | public List getList() {
20 | return list;
21 | }
22 |
23 | /* (non-Javadoc)
24 | * @see java.lang.Object#toString()
25 | */
26 | @Override
27 | public String toString() {
28 | return "Services [list=" + list + "]";
29 | }
30 |
31 | @Override
32 | public Iterator iterator() {
33 | return list.iterator();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/keystone-model/src/main/java/com/woorea/openstack/keystone/v3/model/Users.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.keystone.v3.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | import com.woorea.openstack.keystone.model.User;
10 |
11 | public class Users implements Iterable, Serializable {
12 |
13 | @JsonProperty("users")
14 | private List list;
15 |
16 | /**
17 | * @return the list
18 | */
19 | public List getList() {
20 | return list;
21 | }
22 |
23 | /* (non-Javadoc)
24 | * @see java.lang.Object#toString()
25 | */
26 | @Override
27 | public String toString() {
28 | return "Users [list=" + list + "]";
29 | }
30 |
31 | @Override
32 | public Iterator iterator() {
33 | return list.iterator();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/nova-client/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 | nova-client
9 | OpenStack Nova Client
10 | OpenStack Nova Client
11 |
12 |
13 | com.woorea
14 | openstack-client
15 | 3.2.10-SNAPSHOT
16 |
17 |
18 | com.woorea
19 | nova-model
20 | 3.2.10-SNAPSHOT
21 |
22 |
23 |
--------------------------------------------------------------------------------
/nova-client/src/main/java/com/woorea/openstack/nova/api/ExtensionsResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.api;
2 |
3 |
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.nova.model.Extensions;
8 |
9 | public class ExtensionsResource {
10 |
11 | private final OpenStackClient CLIENT;
12 |
13 | public ExtensionsResource(OpenStackClient client) {
14 | CLIENT = client;
15 | }
16 |
17 | public List list(boolean detail) {
18 | return new List(detail);
19 | }
20 |
21 | public class List extends OpenStackRequest {
22 |
23 | public List(boolean detail) {
24 | super(CLIENT, HttpMethod.GET, detail ? buildPath("extensions", "detail") : buildPath("extensions"), null, Extensions.class);
25 | }
26 |
27 | }
28 |
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/nova-client/src/main/java/com/woorea/openstack/nova/api/HypervisorsResource.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.api;
2 |
3 | import java.util.HashMap;
4 |
5 | import com.woorea.openstack.base.client.Entity;
6 | import com.woorea.openstack.base.client.HttpMethod;
7 | import com.woorea.openstack.base.client.OpenStackClient;
8 | import com.woorea.openstack.base.client.OpenStackRequest;
9 | import com.woorea.openstack.nova.model.Hypervisor;
10 | import com.woorea.openstack.nova.model.Hypervisors;
11 |
12 | /**
13 | * Model for HypervisorsResource
14 | *
15 | */
16 |
17 | public class HypervisorsResource {
18 |
19 | private final OpenStackClient CLIENT;
20 |
21 | public HypervisorsResource(OpenStackClient client) {
22 | this.CLIENT = client;
23 | }
24 |
25 | public List list() {
26 | return new List();
27 | }
28 |
29 | public class List extends OpenStackRequest {
30 |
31 | public List() {
32 | super(CLIENT, HttpMethod.GET, "/os-hypervisors", null, Hypervisors.class);
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CloudpipesExtension.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.api.extensions;
2 |
3 |
4 | import com.woorea.openstack.base.client.Entity;
5 | import com.woorea.openstack.base.client.HttpMethod;
6 | import com.woorea.openstack.base.client.OpenStackClient;
7 | import com.woorea.openstack.base.client.OpenStackRequest;
8 | import com.woorea.openstack.nova.model.Cloudpipe;
9 | import com.woorea.openstack.nova.model.Cloudpipes;
10 |
11 | public class CloudpipesExtension {
12 |
13 | private final OpenStackClient CLIENT;
14 |
15 | public CloudpipesExtension(OpenStackClient client) {
16 | CLIENT = client;
17 | }
18 |
19 | public List list() {
20 | return new List();
21 | }
22 |
23 | public Create create(Cloudpipe cloudpipe) {
24 | return new Create(cloudpipe);
25 | }
26 |
27 | public class List extends OpenStackRequest {
28 |
29 |
30 | public List() {
31 | super(CLIENT, HttpMethod.GET, "/os-cloudpipes", null, Cloudpipes.class);
32 | }
33 |
34 | }
35 |
36 | public class Create extends OpenStackRequest {
37 |
38 | private Cloudpipe cloudpipe;
39 |
40 | public Create(Cloudpipe cloudpipe) {
41 | super(CLIENT, HttpMethod.POST, "/os-cloudpipes", Entity.json(cloudpipe), Cloudpipe.class);
42 | this.cloudpipe = cloudpipe;
43 | }
44 |
45 | }
46 |
47 |
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/CredentialsExtension.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.api.extensions;
2 |
3 |
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.nova.model.Certificate;
8 |
9 | public class CredentialsExtension {
10 |
11 | private final OpenStackClient CLIENT;
12 |
13 | public CredentialsExtension(OpenStackClient client) {
14 | CLIENT = client;
15 | }
16 |
17 | public Create createCertificate(String id) {
18 | return new Create(id);
19 | }
20 |
21 | public Show showCertificate(String id) {
22 | return new Show();
23 | }
24 |
25 | public class Create extends OpenStackRequest {
26 |
27 | public Create(String id) {
28 | super(CLIENT, HttpMethod.GET, new StringBuffer("/os-certificates").append(id).toString(), null, Certificate.class);
29 | }
30 |
31 | }
32 |
33 | public class Show extends OpenStackRequest {
34 |
35 | public Show() {
36 | super(CLIENT, HttpMethod.GET, "/os-certificates", null, Certificate.class);
37 | }
38 |
39 | }
40 |
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/FloatingIpPoolsExtension.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.api.extensions;
2 |
3 |
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.nova.model.FloatingIpPools;
8 |
9 | public class FloatingIpPoolsExtension {
10 |
11 | private final OpenStackClient CLIENT;
12 |
13 | public FloatingIpPoolsExtension(OpenStackClient client) {
14 | CLIENT = client;
15 | }
16 |
17 | public List list() {
18 | return new List();
19 | }
20 |
21 | public class List extends OpenStackRequest {
22 |
23 | public List() {
24 | super(CLIENT, HttpMethod.GET, "/os-floating-ip-pools", null, FloatingIpPools.class);
25 | }
26 |
27 | }
28 |
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HostsExtension.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.api.extensions;
2 |
3 |
4 | import com.woorea.openstack.base.client.HttpMethod;
5 | import com.woorea.openstack.base.client.OpenStackClient;
6 | import com.woorea.openstack.base.client.OpenStackRequest;
7 | import com.woorea.openstack.nova.model.Host;
8 | import com.woorea.openstack.nova.model.Hosts;
9 |
10 | public class HostsExtension {
11 |
12 | private final OpenStackClient CLIENT;
13 |
14 | public HostsExtension(OpenStackClient client) {
15 | CLIENT = client;
16 | }
17 |
18 | public List list() {
19 | return new List();
20 | }
21 |
22 | public Show show(String id) {
23 | return new Show(id);
24 | }
25 |
26 | public class List extends OpenStackRequest {
27 |
28 | public List() {
29 | super(CLIENT, HttpMethod.GET, "/os-hosts", null, Hosts.class);
30 | }
31 |
32 | }
33 |
34 | public class Show extends OpenStackRequest {
35 |
36 | public Show(String id) {
37 | super(CLIENT, HttpMethod.GET, new StringBuffer("/os-hosts/").append(id).toString(), null, Host.class);
38 | }
39 |
40 | }
41 |
42 |
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/nova-client/src/main/java/com/woorea/openstack/nova/api/extensions/HypervisorsExtension.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.api.extensions;
2 |
3 | public class HypervisorsExtension {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/nova-model/pom.xml:
--------------------------------------------------------------------------------
1 |
2 | 4.0.0
3 |
4 | com.woorea
5 | openstack-java-sdk
6 | 3.2.10-SNAPSHOT
7 |
8 |
9 |
10 | javax.xml.bind
11 | jaxb-api
12 | 2.2.12
13 |
14 |
15 | nova-model
16 | OpenStack Nova Model
17 | OpenStack Nova Model
18 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Certificate.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import com.fasterxml.jackson.annotation.JsonRootName;
5 |
6 | @JsonRootName("certificate")
7 | public class Certificate {
8 |
9 | private String data;
10 |
11 | @JsonProperty("private_key")
12 | private String privateKey;
13 |
14 | /**
15 | * @return the data
16 | */
17 | public String getData() {
18 | return data;
19 | }
20 |
21 | /**
22 | * @return the privateKey
23 | */
24 | public String getPrivateKey() {
25 | return privateKey;
26 | }
27 |
28 | /* (non-Javadoc)
29 | * @see java.lang.Object#toString()
30 | */
31 | @Override
32 | public String toString() {
33 | return "Certificate [data=" + data + ", privateKey=" + privateKey + "]";
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Cloudpipes.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.List;
5 |
6 | import com.fasterxml.jackson.annotation.JsonProperty;
7 |
8 | public class Cloudpipes implements Serializable {
9 |
10 | @JsonProperty("cloudpipes")
11 | private List list;
12 |
13 | /**
14 | * @return the list
15 | */
16 | public List getList() {
17 | return list;
18 | }
19 |
20 | /* (non-Javadoc)
21 | * @see java.lang.Object#toString()
22 | */
23 | @Override
24 | public String toString() {
25 | return "Flavors [list=" + list + "]";
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Extension.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Calendar;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonRootName;
8 |
9 | @JsonRootName("extension")
10 | public class Extension implements Serializable {
11 |
12 | private String alias;
13 |
14 | private String description;
15 |
16 | private String name;
17 |
18 | private String namespace;
19 |
20 | private Calendar updated;
21 |
22 | private List links;
23 |
24 | /**
25 | * @return the alias
26 | */
27 | public String getAlias() {
28 | return alias;
29 | }
30 |
31 | /**
32 | * @return the description
33 | */
34 | public String getDescription() {
35 | return description;
36 | }
37 |
38 | /**
39 | * @return the name
40 | */
41 | public String getName() {
42 | return name;
43 | }
44 |
45 | /**
46 | * @return the namespace
47 | */
48 | public String getNamespace() {
49 | return namespace;
50 | }
51 |
52 | /**
53 | * @return the updated
54 | */
55 | public Calendar getUpdated() {
56 | return updated;
57 | }
58 |
59 | /**
60 | * @return the links
61 | */
62 | public List getLinks() {
63 | return links;
64 | }
65 |
66 | /* (non-Javadoc)
67 | * @see java.lang.Object#toString()
68 | */
69 | @Override
70 | public String toString() {
71 | return "Extension [alias=" + alias + ", description=" + description
72 | + ", name=" + name + ", namespace=" + namespace + "]";
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Extensions.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Extensions implements Iterable, Serializable {
10 |
11 | @JsonProperty("extensions")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | /* (non-Javadoc)
27 | * @see java.lang.Object#toString()
28 | */
29 | @Override
30 | public String toString() {
31 | return "Extensions [list=" + list + "]";
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Flavors.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Flavors implements Iterable, Serializable {
10 |
11 | @JsonProperty("flavors")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | /* (non-Javadoc)
27 | * @see java.lang.Object#toString()
28 | */
29 | @Override
30 | public String toString() {
31 | return "Flavors [list=" + list + "]";
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIp.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonProperty;
6 | import com.fasterxml.jackson.annotation.JsonRootName;
7 |
8 | @JsonRootName("floating_ip")
9 | public class FloatingIp implements Serializable {
10 |
11 | private String id;
12 |
13 | private String pool;
14 |
15 | private String ip;
16 |
17 | @JsonProperty("fixed_ip")
18 | private String fixedIp;
19 |
20 | @JsonProperty("instance_id")
21 | private String instanceId;
22 |
23 | /**
24 | * @return the id
25 | */
26 | public String getId() {
27 | return id;
28 | }
29 |
30 | /**
31 | * @return the pool
32 | */
33 | public String getPool() {
34 | return pool;
35 | }
36 |
37 | /**
38 | * @return the ip
39 | */
40 | public String getIp() {
41 | return ip;
42 | }
43 |
44 | /**
45 | * @return the fixedIp
46 | */
47 | public String getFixedIp() {
48 | return fixedIp;
49 | }
50 |
51 | /**
52 | * @return the instanceId
53 | */
54 | public String getInstanceId() {
55 | return instanceId;
56 | }
57 |
58 | /* (non-Javadoc)
59 | * @see java.lang.Object#toString()
60 | */
61 | @Override
62 | public String toString() {
63 | return "FloatingIp [id=" + id + ", pool=" + pool + ", ip=" + ip
64 | + ", fixedIp=" + fixedIp + ", instanceId=" + instanceId + "]";
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpDomain.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonProperty;
6 | import com.fasterxml.jackson.annotation.JsonRootName;
7 |
8 | @JsonRootName("floating-ip-pool")
9 | public class FloatingIpDomain implements Serializable {
10 |
11 | private String domain;
12 |
13 | private String scope;
14 |
15 | private String project;
16 |
17 | @JsonProperty("availabilityZone")
18 | private String availabilityZone;
19 |
20 | /**
21 | * @return the domain
22 | */
23 | public String getDomain() {
24 | return domain;
25 | }
26 |
27 | /**
28 | * @return the scope
29 | */
30 | public String getScope() {
31 | return scope;
32 | }
33 |
34 | /**
35 | * @return the project
36 | */
37 | public String getProject() {
38 | return project;
39 | }
40 |
41 | /**
42 | * @return the availabilityZone
43 | */
44 | public String getAvailabilityZone() {
45 | return availabilityZone;
46 | }
47 |
48 | /* (non-Javadoc)
49 | * @see java.lang.Object#toString()
50 | */
51 | @Override
52 | public String toString() {
53 | return "FloatingIpDomain [domain=" + domain + ", scope=" + scope
54 | + ", project=" + project + ", availabilityZone="
55 | + availabilityZone + "]";
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpDomains.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class FloatingIpDomains implements Iterable, Serializable {
10 |
11 | @JsonProperty("domain_entries")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | /* (non-Javadoc)
27 | * @see java.lang.Object#toString()
28 | */
29 | @Override
30 | public String toString() {
31 | return "FloatingIpDomains [list=" + list + "]";
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIpPools.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | import com.woorea.openstack.nova.model.FloatingIpPools.FloatingIpPool;
10 |
11 | public class FloatingIpPools implements Iterable, Serializable {
12 |
13 | public static class FloatingIpPool implements Serializable {
14 |
15 | private String name;
16 |
17 | /**
18 | * @return the name
19 | */
20 | public String getName() {
21 | return name;
22 | }
23 |
24 | /* (non-Javadoc)
25 | * @see java.lang.Object#toString()
26 | */
27 | @Override
28 | public String toString() {
29 | return "FloatingIpPool [name=" + name + "]";
30 | }
31 |
32 | }
33 |
34 | @JsonProperty("floating_ip_pools")
35 | private List list;
36 |
37 | /**
38 | * @return the list
39 | */
40 | public List getList() {
41 | return list;
42 | }
43 |
44 | @Override
45 | public Iterator iterator() {
46 | return list.iterator();
47 | }
48 |
49 | /* (non-Javadoc)
50 | * @see java.lang.Object#toString()
51 | */
52 | @Override
53 | public String toString() {
54 | return "FloatingIpPools [list=" + list + "]";
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/FloatingIps.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class FloatingIps implements Iterable, Serializable {
10 |
11 | @JsonProperty("floating_ips")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "FloatingIps [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/HostAggregates.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class HostAggregates implements Iterable, Serializable {
10 |
11 | @JsonProperty("aggregates")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | /* (non-Javadoc)
27 | * @see java.lang.Object#toString()
28 | */
29 | @Override
30 | public String toString() {
31 | return "HostAggregates [list=" + list + "]";
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Hosts.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Hosts implements Iterable, Serializable {
10 |
11 | public static final class Host {
12 |
13 | private String zone;
14 |
15 | @JsonProperty("host_name")
16 | private String hostName;
17 |
18 | private String service;
19 |
20 | /**
21 | * @return the hostName
22 | */
23 | public String getHostName() {
24 | return hostName;
25 | }
26 |
27 | /**
28 | * @return the service
29 | */
30 | public String getService() {
31 | return service;
32 | }
33 |
34 | public String getZone() {
35 | return zone;
36 | }
37 |
38 | public void setZone(String zone) {
39 | this.zone = zone;
40 | }
41 |
42 | /* (non-Javadoc)
43 | * @see java.lang.Object#toString()
44 | */
45 | @Override
46 | public String toString() {
47 | return "Host [hostName=" + hostName + ", service=" + service + "]";
48 | }
49 |
50 | }
51 |
52 | @JsonProperty("hosts")
53 | private List list;
54 |
55 | /**
56 | * @return the list
57 | */
58 | public List getList() {
59 | return list;
60 | }
61 |
62 | @Override
63 | public Iterator iterator() {
64 | return list.iterator();
65 | }
66 |
67 | /* (non-Javadoc)
68 | * @see java.lang.Object#toString()
69 | */
70 | @Override
71 | public String toString() {
72 | return "Hosts [list=" + list + "]";
73 | }
74 |
75 |
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Hypervisor.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import com.fasterxml.jackson.annotation.JsonProperty;
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | /**
8 | * Model for Hypervisor
9 | *
10 | */
11 | @JsonRootName("hypervisor")
12 | public class Hypervisor implements Serializable {
13 |
14 | private String id;
15 | private String hypervisor_hostname;
16 |
17 | public String getId() {
18 | return id;
19 | }
20 |
21 | public void setHypervisor_hostname(String hypervisor_hostname) {
22 | this.hypervisor_hostname = hypervisor_hostname;
23 | }
24 |
25 | public String getHypervisor_hostname() {
26 | return hypervisor_hostname;
27 | }
28 |
29 | @Override
30 | public String toString() {
31 | return "Hypervisor {"
32 | + "hypervisor_hostname='" + hypervisor_hostname
33 | + ", id='" + id
34 | + '}';
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Hypervisors.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.util.Iterator;
4 | import java.util.List;
5 | import com.fasterxml.jackson.annotation.JsonProperty;
6 |
7 | /**
8 | * Model for List of Hypervisors
9 | *
10 | */
11 | public class Hypervisors implements Iterable {
12 |
13 | @JsonProperty("hypervisors")
14 | private List list;
15 |
16 | public List getList() {
17 | return list;
18 | }
19 |
20 | public void setList(List list) {
21 | this.list = list;
22 | }
23 |
24 | @Override
25 | public Iterator iterator() {
26 | return list.iterator();
27 | }
28 |
29 | @Override
30 | public String toString() {
31 | return "Hypervisors [list=" + list + "]";
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Images.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Images implements Iterable, Serializable {
10 |
11 | @JsonProperty("images")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 |
27 | /* (non-Javadoc)
28 | * @see java.lang.Object#toString()
29 | */
30 | @Override
31 | public String toString() {
32 | return "Images [list=" + list + "]";
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/KeyPairs.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.ArrayList;
5 | import java.util.Iterator;
6 | import java.util.List;
7 |
8 | import com.fasterxml.jackson.annotation.JsonProperty;
9 |
10 | public class KeyPairs implements Iterable, Serializable {
11 |
12 | public static final class KeyPairWrapper implements Serializable {
13 |
14 | @JsonProperty
15 | private KeyPair keypair;
16 |
17 | }
18 |
19 | @JsonProperty("keypairs")
20 | private List list;
21 |
22 | /**
23 | * @return the list
24 | */
25 | public List getList() {
26 | List list = new ArrayList();
27 | for(KeyPairWrapper wrapper : this.list) {
28 | list.add(wrapper.keypair);
29 | }
30 | return list;
31 | }
32 |
33 | @Override
34 | public Iterator iterator() {
35 | return getList().iterator();
36 | }
37 |
38 | /* (non-Javadoc)
39 | * @see java.lang.Object#toString()
40 | */
41 | @Override
42 | public String toString() {
43 | return "KeyPairs [list=" + getList() + "]";
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Link.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 |
5 | public class Link implements Serializable {
6 |
7 | private String rel;
8 |
9 | private String href;
10 |
11 | private String type;
12 |
13 | /**
14 | * @return the rel
15 | */
16 | public String getRel() {
17 | return rel;
18 | }
19 |
20 | /**
21 | * @return the href
22 | */
23 | public String getHref() {
24 | return href;
25 | }
26 |
27 | /**
28 | * @return the type
29 | */
30 | public String getType() {
31 | return type;
32 | }
33 |
34 | /* (non-Javadoc)
35 | * @see java.lang.Object#toString()
36 | */
37 | @Override
38 | public String toString() {
39 | return "Link [rel=" + rel + ", href=" + href + ", type=" + type + "]";
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Metadata.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.util.Map;
4 |
5 | public class Metadata {
6 |
7 | private Map metadata;
8 |
9 | /**
10 | * @return the metadata
11 | */
12 | public Map getMetadata() {
13 | return metadata;
14 | }
15 |
16 | /**
17 | * Set the metadata
18 | * @param metadata
19 | */
20 | public void setMetadata(Map metadata) {
21 | this.metadata = metadata;
22 | }
23 |
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/NetworkForCreate.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import com.fasterxml.jackson.annotation.JsonProperty;
4 | import com.fasterxml.jackson.annotation.JsonRootName;
5 |
6 | public class NetworkForCreate {
7 |
8 | @JsonProperty("uuid")
9 | private String id;
10 | @JsonProperty("fixed_ip")
11 | private String fixedIp;
12 |
13 | public String getId() {
14 | return id;
15 | }
16 |
17 | public String getFixedIp() {
18 | return fixedIp;
19 | }
20 |
21 | public void setId(String id) {
22 | this.id = id;
23 | }
24 |
25 | public void setFixedIp(String fixedIp) {
26 | this.fixedIp = fixedIp;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Networks.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Networks implements Iterable, Serializable {
10 |
11 | @JsonProperty("networks")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "Servers [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/PersonalityFile.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 |
5 | public final class PersonalityFile implements Serializable {
6 |
7 | private String path;
8 |
9 | private String contents;
10 |
11 | /**
12 | * @return the path
13 | */
14 | public String getPath() {
15 | return path;
16 | }
17 |
18 | /**
19 | * @param path the path to set
20 | */
21 | public void setPath(String path) {
22 | this.path = path;
23 | }
24 |
25 | /**
26 | * @return the contents
27 | */
28 | public String getContents() {
29 | return contents;
30 | }
31 |
32 | /**
33 | * @param contents the contents to set
34 | */
35 | public void setContents(String contents) {
36 | this.contents = contents;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroupForCreate.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 |
5 | import com.fasterxml.jackson.annotation.JsonRootName;
6 |
7 | @JsonRootName("security_group")
8 | public class SecurityGroupForCreate implements Serializable {
9 |
10 | private String name;
11 |
12 | private String description;
13 |
14 | public SecurityGroupForCreate() {
15 | super();
16 | }
17 |
18 | public SecurityGroupForCreate(String name) {
19 | this.name = name;
20 | }
21 |
22 | public SecurityGroupForCreate(String name, String description) {
23 | this(name);
24 | this.description = description;
25 | }
26 |
27 | /**
28 | * @return the name
29 | */
30 | public String getName() {
31 | return name;
32 | }
33 |
34 | /**
35 | * @param name the name to set
36 | */
37 | public void setName(String name) {
38 | this.name = name;
39 | }
40 |
41 | /**
42 | * @return the description
43 | */
44 | public String getDescription() {
45 | return description;
46 | }
47 |
48 | /**
49 | * @param description the description to set
50 | */
51 | public void setDescription(String description) {
52 | this.description = description;
53 | }
54 |
55 | /* (non-Javadoc)
56 | * @see java.lang.Object#toString()
57 | */
58 | @Override
59 | public String toString() {
60 | return "SecurityGroupForCreate [name=" + name + ", description="
61 | + description + "]";
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/SecurityGroups.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class SecurityGroups implements Iterable, Serializable {
10 |
11 | @JsonProperty("security_groups")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | /* (non-Javadoc)
22 | * @see java.lang.Object#toString()
23 | */
24 | @Override
25 | public String toString() {
26 | return "SecurityGroups [list=" + list + "]";
27 | }
28 |
29 | @Override
30 | public Iterator iterator() {
31 | return list.iterator();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Servers.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class Servers implements Iterable, Serializable {
10 |
11 | @JsonProperty("servers")
12 | private List list;
13 |
14 | /**
15 | * @return the list
16 | */
17 | public List getList() {
18 | return list;
19 | }
20 |
21 | @Override
22 | public Iterator iterator() {
23 | return list.iterator();
24 | }
25 |
26 | /* (non-Javadoc)
27 | * @see java.lang.Object#toString()
28 | */
29 | @Override
30 | public String toString() {
31 | return "Servers [list=" + list + "]";
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/Services.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.util.Iterator;
4 | import java.util.List;
5 | import com.fasterxml.jackson.annotation.JsonProperty;
6 |
7 | /**
8 | * Model for List of Services
9 | *
10 | */
11 | public class Services implements Iterable {
12 |
13 | @JsonProperty("services")
14 | private List list;
15 |
16 | public List getList() {
17 | return list;
18 | }
19 |
20 | public void setList(List list) {
21 | this.list = list;
22 | }
23 |
24 | @Override
25 | public Iterator iterator() {
26 | return list.iterator();
27 | }
28 |
29 | @Override
30 | public String toString() {
31 | return "Services [list=" + list + "]";
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/nova-model/src/main/java/com/woorea/openstack/nova/model/SimpleTenantUsages.java:
--------------------------------------------------------------------------------
1 | package com.woorea.openstack.nova.model;
2 |
3 | import java.io.Serializable;
4 | import java.util.Iterator;
5 | import java.util.List;
6 |
7 | import com.fasterxml.jackson.annotation.JsonProperty;
8 |
9 | public class SimpleTenantUsages implements Iterable