public interface UserApi
User
Modifier and Type | Method and Description |
---|---|
void |
create(Set<User> users)
Create database users.
|
void |
create(String userName,
String password,
String databaseName)
Create a database user by name, password, and database name.
|
void |
create(String userName,
String password,
String host,
String databaseName)
Create a database user by name, password, and database name.
|
boolean |
delete(String userName)
This operation deletes the specified user for the specified database instance.
|
User |
get(String name)
Returns a User by identifier.
|
User |
get(String name,
String hostname)
Returns a User by name and allowed host.
|
com.google.common.collect.FluentIterable<String> |
getDatabaseList(String userName)
This operation shows a list of all databases to which a user has access.
|
void |
grant(String userName,
List<String> databases)
This operation grants access for the specified user to a database for the specified instance.
|
void |
grant(String userName,
String databaseName)
This operation grants access for the specified user to a database for the specified instance.
|
com.google.common.collect.FluentIterable<User> |
list()
This operation lists the users in the specified database instance.
|
boolean |
revoke(String userName,
String databaseName)
This operation grants access for the specified user to a database for the specified instance.
|
@Named(value="user:create") void create(Set<User> users)
users
- List of users to be created.@Named(value="user:create") void create(String userName, String password, String databaseName)
#create(String, Set)
.userName
- Name of the user for the database.password
- User password for database access.databaseName
- Name of the database that the user can access.@Named(value="user:create") void create(String userName, String password, String host, String databaseName)
#create(String, Set)
.userName
- Name of the user for the database.password
- User password for database access.host
- Specifies the host from which a user is allowed to connect to the database. Possible values are a string containing an IPv4 address or "%" to allow connecting from any host. Refer to Section 3.11.1, “User Access Restriction by Host” for details. If host is not specified, it defaults to "%".databaseName
- Name of the database that the user can access.@Named(value="user:grant") void grant(String userName, List<String> databases)
userName
- The name of the specified user.databases
- List of the databases that the user should be granted access to.@Named(value="user:grant") void grant(String userName, String databaseName)
#create(String, Set)
.
The user is granted all privileges.userName
- Name of the user for the database.databaseName
- Name of the database that the user can access.@Named(value="user:revoke") boolean revoke(String userName, String databaseName)
userName
- Name of the user for the database.databaseName
- Name of the database that the user can access.@Named(value="users:delete/{name}") boolean delete(String userName)
userName
- The name for the specified user.@Named(value="user:list") com.google.common.collect.FluentIterable<User> list()
@Named(value="user:getDatabaseList/{name}") com.google.common.collect.FluentIterable<String> getDatabaseList(String userName)
instanceId
- The instance ID for the specified database instance.userName
- The name for the specified user.@Named(value="user:get/{name}") @Nullable User get(String name)
name
- The name or identifier for the specified user.Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.