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);
- }
-
- public ProjectUserRolesResource userRoles(String projectId, String userId) {
- return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/users/").append(userId).append("/roles").toString());
- }
-
- public ProjectUserRolesResource groupRoles(String projectId, String groupId) {
- return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/groups/").append(groupId).append("/roles").toString());
- }
+ 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);
+ }
+
+ public ProjectUserRolesResource userRoles(String projectId, String userId) {
+ return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/users/").append(userId).append("/roles").toString());
+ }
+
+ public ProjectUserRolesResource groupRoles(String projectId, String groupId) {
+ return new ProjectUserRolesResource(CLIENT, new StringBuilder(path).append("/").append(projectId).append("/groups/").append(groupId).append("/roles").toString());
+ }
}
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);
- }
+ 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);
+ }
}
public class ServicesResource extends GenericResource<Service, Services> {
- public ServicesResource(OpenStackClient client) {
- super(client, "/services", Service.class, Services.class);
- }
+ public ServicesResource(OpenStackClient client) {
+ super(client, "/services", Service.class, Services.class);
+ }
}
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);
- }
+
+ 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;
- }
+ 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;
+ }
- }
-
+ }
+
}
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);
- }
-
- public OpenStackRequest<Services> projects(String userId) {
- 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);
- }
+ 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);
+ }
+
+ public OpenStackRequest<Services> projects(String userId) {
+ 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);
+ }
}