diff options
author | Smokowski, Steve (ss835w) <ss835w@us.att.com> | 2019-05-02 09:42:55 -0400 |
---|---|---|
committer | Smokowski, Steve (ss835w) <ss835w@us.att.com> | 2019-05-07 10:02:17 -0400 |
commit | 3f9a0c3183480d150089c0d5a6e507c877f7d121 (patch) | |
tree | b3db04cbe2cef23f81503177a50edc5360ffa486 /keystone-client/src/main/java | |
parent | e153f0adfbed711ce1e215748594a4d04fd1edaf (diff) |
Enhance Openstack Client
Update Openstack Client to support additional fields
Updat all formatting issues
Issue-ID: SO-1844
Change-Id: I1369e0c18cc25274db8df7e12855a020b8da38da
Signed-off-by: Smokowski, Steve (ss835w) <ss835w@us.att.com>
Diffstat (limited to 'keystone-client/src/main/java')
18 files changed, 145 insertions, 134 deletions
diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/EndpointsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/EndpointsResource.java index db970a5..cf1909c 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/EndpointsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/EndpointsResource.java @@ -25,63 +25,63 @@ import com.woorea.openstack.keystone.model.Endpoint; import com.woorea.openstack.keystone.model.Endpoints; public class EndpointsResource { - + private OpenStackClient client; - + public EndpointsResource(OpenStackClient client) { this.client = client; } - + public List list() { return new List(); } - + public Create create(Endpoint endpoint) { return new Create(endpoint); } - + public Show show(String id) { return new Show(id); } - + public Delete delete(String id) { return new Delete(id); } public class List extends OpenStackRequest<Endpoints> { - + public List() { super(client, HttpMethod.GET, "/endpoints", null, Endpoints.class); } } - + public class Create extends OpenStackRequest<Endpoint> { private Endpoint endpoint; - + public Create(Endpoint endpoint) { super(client, HttpMethod.POST, "/endpoints", Entity.json(endpoint), Endpoint.class); this.endpoint = endpoint; } - + } - + public class Show extends OpenStackRequest<Endpoint> { - + public Show(String id) { super(client, HttpMethod.GET, new StringBuilder("/endpoints/").append(id).toString(), null, Endpoint.class); } } - + public class Delete extends OpenStackRequest<Void> { - + public Delete(String id) { super(client, HttpMethod.DELETE, new StringBuilder("/endpoints/").append(id).toString(), null, Void.class); } - + } - + } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/RolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/RolesResource.java index 71641fb..e7193b5 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/RolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/RolesResource.java @@ -25,50 +25,51 @@ import com.woorea.openstack.keystone.model.Role; import com.woorea.openstack.keystone.model.Roles; public class RolesResource { - + private OpenStackClient client; - + public RolesResource(OpenStackClient client) { this.client = client; } - + public List list() { return new List(); } - + public Create create(Role role) { return new Create(role); } - + public Delete delete(String id) { return new Delete(id); } public class List extends OpenStackRequest<Roles> { - + public List() { super(client, HttpMethod.GET, "/OS-KSADM/roles", null, Roles.class); } } - + public class Create extends OpenStackRequest<Role> { private Role role; - + public Create(Role role) { super(client, HttpMethod.POST, "/OS-KSADM/roles", Entity.json(role), Role.class); this.role = role; } - + } - + public class Delete extends OpenStackRequest<Void> { - + public Delete(String id) { - super(client, HttpMethod.DELETE, new StringBuilder("/OS-KSADM/roles/").append(id).toString(), null, Void.class); + super(client, HttpMethod.DELETE, new StringBuilder("/OS-KSADM/roles/").append(id).toString(), null, + Void.class); } - + } - + } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/ServicesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/ServicesResource.java index 315d2be..033846f 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/ServicesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/ServicesResource.java @@ -25,62 +25,64 @@ import com.woorea.openstack.keystone.model.Service; import com.woorea.openstack.keystone.model.Services; public class ServicesResource { - + private OpenStackClient client; - + public ServicesResource(OpenStackClient client) { this.client = client; } - + public List list() { return new List(); } - + public Create create(Service service) { return new Create(service); } - + public Show show(String id) { return new Show(id); } - + public Delete delete(String id) { return new Delete(id); } public class List extends OpenStackRequest<Services> { - + public List() { super(client, HttpMethod.GET, "/OS-KSADM/services", null, Services.class); } } - + public class Create extends OpenStackRequest<Service> { private Service service; - + public Create(Service service) { super(client, HttpMethod.POST, "/OS-KSADM/services", Entity.json(service), Service.class); this.service = service; } - + } - + public class Show extends OpenStackRequest<Service> { - + public Show(String id) { - super(client, HttpMethod.GET, new StringBuilder("/OS-KSADM/services/").append(id).toString(), null, Service.class); + super(client, HttpMethod.GET, new StringBuilder("/OS-KSADM/services/").append(id).toString(), null, + Service.class); } } - + public class Delete extends OpenStackRequest<Void> { - + public Delete(String id) { - super(client, HttpMethod.DELETE, new StringBuilder("/OS-KSADM/services/").append(id).toString(), null, Void.class); + super(client, HttpMethod.DELETE, new StringBuilder("/OS-KSADM/services/").append(id).toString(), null, + Void.class); } - + } - + } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TenantsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TenantsResource.java index 0d0a027..3fbf545 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TenantsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/TenantsResource.java @@ -130,8 +130,7 @@ public class TenantsResource { private Tenant tenant; public Update(String id, Tenant tenant) { - super(client, HttpMethod.PUT, getTenantsString(id).toString(), Entity.json(tenant), - Tenant.class); + super(client, HttpMethod.PUT, getTenantsString(id).toString(), Entity.json(tenant), Tenant.class); this.tenant = tenant; } } @@ -146,16 +145,14 @@ public class TenantsResource { public class ListUsers extends OpenStackRequest<Users> { public ListUsers(String tenantId) { - super(client, HttpMethod.GET,getTenantsString(tenantId).append("/users").toString(), - null, Users.class); + super(client, HttpMethod.GET, getTenantsString(tenantId).append("/users").toString(), null, Users.class); } } public class AddUser extends OpenStackRequest<Void> { public AddUser(String tenantId, String userId, String roleId) { - super(client, HttpMethod.PUT, - getTenantsString(tenantId).append(USERS).append(userId) + super(client, HttpMethod.PUT, getTenantsString(tenantId).append(USERS).append(userId) .append("/roles/OS-KSADM/").append(roleId).toString(), null, Void.class); } } @@ -163,8 +160,7 @@ public class TenantsResource { public class RemoveUser extends OpenStackRequest<Void> { public RemoveUser(String tenantId, String userId, String roleId) { - super(client, HttpMethod.DELETE, - getTenantsString(tenantId).append(USERS).append(userId) + super(client, HttpMethod.DELETE, getTenantsString(tenantId).append(USERS).append(userId) .append("/roles/OS-KSADM/").append(roleId).toString(), null, Void.class); } } @@ -173,15 +169,14 @@ public class TenantsResource { public ListUserRoles(String tenantId, String userId) { super(client, HttpMethod.GET, - getTenantsString(tenantId).append(USERS).append(userId).append("/roles") - .toString(), null, Roles.class); + getTenantsString(tenantId).append(USERS).append(userId).append("/roles").toString(), null, + Roles.class); } } /** - * The following APIs support Tenant-level metadata. This is a feature supported - * by the DCP/LCP (i.e. AIC cloud), but not native Openstack. The full API as - * documented by AIC is implemented below. + * The following APIs support Tenant-level metadata. This is a feature supported by the DCP/LCP (i.e. AIC cloud), + * but not native Openstack. The full API as documented by AIC is implemented below. */ public class ShowMetadata extends OpenStackRequest<Metadata> { @@ -194,7 +189,7 @@ public class TenantsResource { public CreateOrUpdateMetadata(String tenantId, Metadata metadata) { super(client, HttpMethod.POST, getTenantsString(tenantId).append(METADATA), Entity.json(metadata), - Metadata.class); + Metadata.class); } } @@ -202,32 +197,31 @@ public class TenantsResource { public ReplaceMetadata(String tenantId, Metadata metadata) { super(client, HttpMethod.PUT, getTenantsString(tenantId).append(METADATA), Entity.json(metadata), - Metadata.class); + Metadata.class); } } public class ShowMetadataItem extends OpenStackRequest<Metadata> { public ShowMetadataItem(String tenantId, String key) { - super(client, HttpMethod.GET, - getTenantsString(tenantId).append(METADATA).append(key), null, Metadata.class); + super(client, HttpMethod.GET, getTenantsString(tenantId).append(METADATA).append(key), null, + Metadata.class); } } public class CreateOrUpdateMetadataItem extends OpenStackRequest<Metadata> { public CreateOrUpdateMetadataItem(String tenantId, String key, Metadata metadata) { - super(client, HttpMethod.POST, - getTenantsString(tenantId).append(METADATA).append(key), Entity.json(metadata), - Metadata.class); + super(client, HttpMethod.POST, getTenantsString(tenantId).append(METADATA).append(key), + Entity.json(metadata), Metadata.class); } } public class DeleteMetadataItem extends OpenStackRequest<Void> { public DeleteMetadataItem(String tenantId, String key) { - super(client, HttpMethod.DELETE, - getTenantsString(tenantId).append("/metadata/").append(key), null, Void.class); + super(client, HttpMethod.DELETE, getTenantsString(tenantId).append("/metadata/").append(key), null, + Void.class); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/UsersResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/UsersResource.java index 87b7a46..bb02043 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/api/UsersResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/api/UsersResource.java @@ -82,8 +82,7 @@ public class UsersResource { private User user; public Update(String id, User user) { - super(client, HttpMethod.PUT, getUserString(id), Entity.json(user), - User.class); + super(client, HttpMethod.PUT, getUserString(id), Entity.json(user), User.class); this.user = user; } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneTokenProvider.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneTokenProvider.java index c3f52e6..97973fd 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneTokenProvider.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneTokenProvider.java @@ -42,9 +42,8 @@ public class KeystoneTokenProvider { public Access getAccessByTenant(String tenantName) { Access access = hashTenantAccess.get(tenantName); if (access == null) { - access = keystone.tokens().authenticate(new UsernamePassword(username, password)) - .withTenantName(tenantName) - .execute(); + access = keystone.tokens().authenticate(new UsernamePassword(username, password)).withTenantName(tenantName) + .execute(); hashTenantAccess.put(tenantName, access); } return access; @@ -59,8 +58,7 @@ public class KeystoneTokenProvider { return new OpenStackTokenProvider() { @Override public String getToken() { - return keystoneTokenProvider.getAccessByTenant(tenantName) - .getToken().getId(); + return keystoneTokenProvider.getAccessByTenant(tenantName).getToken().getId(); } @Override diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneUtils.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneUtils.java index 6f81781..29f41df 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneUtils.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/utils/KeystoneUtils.java @@ -21,8 +21,7 @@ import java.util.List; public class KeystoneUtils { - private KeystoneUtils() { - } + private KeystoneUtils() {} public static String findEndpointURL(List<Service> serviceCatalog, String type, String region, String facing) { for (Service service : serviceCatalog) { diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java index 44ffb2d..c7d547b 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainUserRolesResource.java @@ -30,11 +30,13 @@ public class DomainUserRolesResource extends GenericResource<Role, Roles> { } public OpenStackRequest<Void> add(String roleId) { - return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, + new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); } - + public OpenStackRequest<Void> remove(String roleId) { - return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, + new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java index c04aba0..d0e5665 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/DomainsResource.java @@ -25,13 +25,15 @@ public class DomainsResource extends GenericResource<Domain, Domains> { public DomainsResource(OpenStackClient client) { super(client, "/domains", Domain.class, Domains.class); } - + public DomainUserRolesResource userRoles(String domainId, String userId) { - return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString()); + return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId) + .append("/users/").append(userId).append("/roles").toString()); } - + public DomainUserRolesResource groupRoles(String domainId, String groupId) { - return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/groups/").append(groupId).append("/roles").toString()); + return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId) + .append("/groups/").append(groupId).append("/roles").toString()); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java index c27ab8b..1c1b4fa 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GenericResource.java @@ -24,37 +24,40 @@ import com.woorea.openstack.base.client.OpenStackRequest; public class GenericResource<One, Many> { protected final OpenStackClient CLIENT; - + protected CharSequence path; - + protected Class<One> oneClass; protected Class<Many> manyClass; - + public GenericResource(OpenStackClient client, CharSequence path, Class<One> oneClass, Class<Many> manyClass) { CLIENT = client; this.path = path; this.oneClass = oneClass; this.manyClass = manyClass; } - + public OpenStackRequest<Many> list() { return new OpenStackRequest<>(CLIENT, HttpMethod.GET, path, null, manyClass); } - + public OpenStackRequest<One> create(One one) { return new OpenStackRequest<>(CLIENT, HttpMethod.POST, path, Entity.json(one), oneClass); } - + public OpenStackRequest<One> show(String id) { - return new OpenStackRequest<>(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); + return new OpenStackRequest<>(CLIENT, HttpMethod.GET, new StringBuilder(path).append("/").append(id).toString(), + null, oneClass); } - + public OpenStackRequest<One> update(String id, One one) { - return new OpenStackRequest<>(CLIENT, HttpMethod.PATCH, new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass); + return new OpenStackRequest<>(CLIENT, HttpMethod.PATCH, + new StringBuilder(path).append("/").append(id).toString(), Entity.json(one), oneClass); } - + public OpenStackRequest<One> delete(String id) { - return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(id).toString(), null, oneClass); + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, + new StringBuilder(path).append("/").append(id).toString(), null, oneClass); } - + } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java index c3b760f..6514ae6 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/GroupsResource.java @@ -25,9 +25,10 @@ public class GroupsResource extends GenericResource<Group, Groups> { public GroupsResource(OpenStackClient client) { super(client, "/groups", Group.class, Groups.class); } - + public DomainUserRolesResource userRoles(String domainId, String userId) { - return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString()); + return new DomainUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(domainId) + .append("/users/").append(userId).append("/roles").toString()); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/PoliciesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/PoliciesResource.java index d22416d..1a8fb42 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/PoliciesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/PoliciesResource.java @@ -17,7 +17,6 @@ package com.woorea.openstack.keystone.v3.api; import com.woorea.openstack.base.client.OpenStackClient; - import com.woorea.openstack.keystone.v3.model.Policies; import com.woorea.openstack.keystone.v3.model.Policy; diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java index a2cd01c..4e26d88 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectRolesResource.java @@ -22,22 +22,24 @@ import com.woorea.openstack.base.client.OpenStackClient; import com.woorea.openstack.base.client.OpenStackRequest; public class ProjectRolesResource { - + private final OpenStackClient CLIENT; - + private final String PATH; public ProjectRolesResource(OpenStackClient client, String path) { this.CLIENT = client; this.PATH = path; } - + public OpenStackRequest<Void> add(String roleId) { - return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, new StringBuilder(PATH).append("/").append(roleId).toString(), Entity.json(""), Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, + new StringBuilder(PATH).append("/").append(roleId).toString(), Entity.json(""), Void.class); } - + public OpenStackRequest<Void> remove(String roleId) { - return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(PATH).append("/").append(roleId).toString(), null, Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, + new StringBuilder(PATH).append("/").append(roleId).toString(), null, Void.class); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java index 95f5d0c..9868882 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectUserRolesResource.java @@ -28,13 +28,15 @@ public class ProjectUserRolesResource extends GenericResource<Role, Roles> { public ProjectUserRolesResource(OpenStackClient client, String path) { super(client, path, Role.class, Roles.class); } - + public OpenStackRequest<Void> add(String roleId) { - return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.PUT, + new StringBuilder(path).append("/").append(roleId).toString(), Entity.json(""), Void.class); } - + public OpenStackRequest<Void> remove(String roleId) { - return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); + return new OpenStackRequest<>(CLIENT, HttpMethod.DELETE, + new StringBuilder(path).append("/").append(roleId).toString(), null, Void.class); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java index 900ce20..a5cb8f2 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/ProjectsResource.java @@ -27,17 +27,20 @@ public class ProjectsResource extends GenericResource<Project, Projects> { public ProjectsResource(OpenStackClient client) { super(client, "/projects", Project.class, Projects.class); } - + public OpenStackRequest<Users> users(String projectId) { - return CLIENT.get(new StringBuilder(path).append("/").append(projectId).append("/users/").toString(), Users.class); + return CLIENT.get(new StringBuilder(path).append("/").append(projectId).append("/users/").toString(), + Users.class); } - + public ProjectUserRolesResource userRoles(String projectId, String userId) { - return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/users/").append(userId).append("/roles").toString()); + return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId) + .append("/users/").append(userId).append("/roles").toString()); } - + public ProjectUserRolesResource groupRoles(String projectId, String groupId) { - return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/groups/").append(groupId).append("/roles").toString()); + return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId) + .append("/groups/").append(groupId).append("/roles").toString()); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java index ae8fc60..864764d 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/RolesResource.java @@ -27,9 +27,10 @@ public class RolesResource extends GenericResource<Role, Roles> { public RolesResource(OpenStackClient client) { super(client, "/roles", Role.class, Roles.class); } - + public OpenStackRequest<Users> users(String domainId, String userId) { - return CLIENT.get(new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId).append("/roles").toString(), Users.class); + return CLIENT.get(new StringBuilder(path).append("/").append(domainId).append("/users/").append(userId) + .append("/roles").toString(), Users.class); } } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java index 9d176d7..fda51f2 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/TokensResource.java @@ -24,35 +24,35 @@ import com.woorea.openstack.keystone.v3.model.Authentication; import com.woorea.openstack.keystone.v3.model.Token; public class TokensResource { - + private final OpenStackClient CLIENT; - + public TokensResource(OpenStackClient client) { CLIENT = client; } - + public Authenticate authenticate(Authentication authentication) { return new Authenticate(authentication); } - + public OpenStackRequest<Token> show() { return CLIENT.get("/auth/tokens", Token.class); } public class Authenticate extends OpenStackRequest<Token> { - + private Authentication authentication; - + public Authenticate() { - + } - + public Authenticate(Authentication authentication) { super(CLIENT, HttpMethod.POST, "/auth/tokens", Entity.json(authentication), Token.class); this.authentication = authentication; } } - + } diff --git a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java index 0e1e609..dc6894a 100644 --- a/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java +++ b/keystone-client/src/main/java/com/woorea/openstack/keystone/v3/api/UsersResource.java @@ -27,17 +27,20 @@ public class UsersResource extends GenericResource<User, Users> { public UsersResource(OpenStackClient client) { super(client, "/users", User.class, Users.class); } - + public OpenStackRequest<Services> groups(String userId) { - return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/groups").toString(), Services.class); + return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/groups").toString(), + Services.class); } - + public OpenStackRequest<Services> projects(String userId) { - return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/projects").toString(), Services.class); + return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/projects").toString(), + Services.class); } - + public OpenStackRequest<Services> roles(String userId) { - return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/roles").toString(), Services.class); + return CLIENT.get(new StringBuilder(path).append("/").append(userId).append("/roles").toString(), + Services.class); } } |