API admin - RapturePlatform/Rapture GitHub Wiki
The Admin API is used to manipulate and access the low level entities in Rapture. Typically the methods in this API are only used during significant setup events in a Rapture environment.
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
Map<String,String> retVal = adminApi.getSystemProperties(keys);
retVal = baseAPI.doAdmin_GetSystemProperties(keys);
Entitlement: /admin/main
This function retrieves the system properties in use for this instance of Rapture. As system propertiesare often used to control external connectivity, a client can determine the inferred connectivity endpointsby using this api call. It returns a map from system property name (the key) to value. You cannot modify thesystem properties of Rapture through the api, they are set by the administrator as part of the general setup of a Rapturesystem. Note that this call returns the properties for the actual end point that the client is connected to, it is not necessarily true thatthe same properties will be set for every API endpoint.
Parameter | Type | Description |
---|---|---|
keys | List |
Type | Description |
---|---|
Map<String,String> |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
List<RepoConfig> retVal = adminApi.getRepoConfig();
retVal = baseAPI.doAdmin_GetRepoConfig();
Entitlement: /admin/main
Rapture is a hierarchical set of repositories, and this method returns the config of the top most level - that usedfor general config and temporary (transient) values such as sessions. In clustered mode these configs wouldbe referencing shared storage, and in test mode they would normally refer to in-memory versions of the config. The manipulation of the top level config can be performed through the Bootstrap API.
This function takes no parameters.
Type | Description |
---|---|
List |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
List<CallingContext> retVal = adminApi.getSessionsForUser(user);
retVal = baseAPI.doAdmin_GetSessionsForUser(user);
Entitlement: /admin/main
When a user logs into Rapture they create a transient session and this method is a way of retrieving all of the sessions for a given user. The CallingContext is a common object passed around Rapture api calls.
Parameter | Type | Description |
---|---|---|
user | String |
Type | Description |
---|---|
List |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
List<String> retVal = adminApi.getTags(raptureURI);
retVal = baseAPI.doAdmin_GetTags(raptureURI);
Entitlement: /admin/main
A type that is using a versioned repository will be able to use tags - these are fixed points in time (that are invariant) that reflect what the repository looked like when the tag was created. For example a tag could be assigned to a repository that marks the end of day view for a repository. Any changes made after this tag was created will be accessible in the normal perspective but will not be associated with the tag. This method returns all of the tags associated with this type in the given authority.
Parameter | Type | Description |
---|---|---|
raptureURI | String |
Type | Description |
---|---|
List |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.deleteUser(userName);
retVal = baseAPI.doAdmin_DeleteUser(userName);
Entitlement: /admin/main
This method removes a user from this Rapture system. The user is removed from all entitlement groups also. The actualuser definition is retained and marked as inactive (so the user cannot login). This is because the user may still be referenced in audit trails and the change history in type repositories.
Parameter | Type | Description |
---|---|---|
userName | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.destroyUser(userName);
retVal = baseAPI.doAdmin_DestroyUser(userName);
Entitlement: /admin/main
This method destroys a user record. The user must have been previously disabled using 'deleteUser' before this method may be called. This is a severe method that should only be used in non-production machines or to correct an administrativeerror in creating an account with the wrong name before that account has been used. Reference to the missing user may stillexist, and may not display properly in some UIs
Parameter | Type | Description |
---|---|---|
userName | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.restoreUser(userName);
retVal = baseAPI.doAdmin_RestoreUser(userName);
Entitlement: /admin/main
This method restores a user that has been deleted
Parameter | Type | Description |
---|---|---|
userName | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.addUser(userName, description, hashPassword, email);
retVal = baseAPI.doAdmin_AddUser(userName, description, hashPassword, email);
Entitlement: /admin/main
This method adds a user to the Rapture environment. The user will be in no entitlement groups by default. The passwordfield passed is actually the MD5 hash of the password
- or at least the same hash function that will be applied whenlogging in to the system (the password is hashed, and then hashed again with the salt returned during the login protocol).
Parameter | Type | Description |
---|---|---|
userName | String | |
description | String | |
hashPassword | String | |
String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
boolean retVal = adminApi.doesUserExist(userName);
retVal = baseAPI.doAdmin_DoesUserExist(userName);
Entitlement: /admin/main
This api call can be used to determine whether a given user exists in the Rapture system. Only system administrators can use this api call.
Parameter | Type | Description |
---|---|---|
userName | String |
Type | Description |
---|---|
boolean |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
RaptureUser retVal = adminApi.getUser(userName);
retVal = baseAPI.doAdmin_GetUser(userName);
Entitlement: /admin/main
Retrieve a single user given their name.
Parameter | Type | Description |
---|---|---|
userName | String |
Type | Description |
---|---|
RaptureUser |
Defines a user account for the Rapture system.
Field | Type |
---|---|
username | String |
userId | String |
emailAddress | String |
salt | String |
hashPassword | String |
description | String |
inactive | Boolean |
apiKey | Boolean |
hasRoot | Boolean |
passwordResetToken | String |
tokenExpirationTime | Long |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
RaptureUser retVal = adminApi.generateApiUser(prefix, description);
retVal = baseAPI.doAdmin_GenerateApiUser(prefix, description);
Entitlement: /admin/main
Generates an api user, for use in connecting to Rapture in a relatively opaque way using a shared secret. An api user can log in with their access key without a password.
Parameter | Type | Description |
---|---|---|
prefix | String | |
description | String |
Type | Description |
---|---|
RaptureUser |
Defines a user account for the Rapture system.
Field | Type |
---|---|
username | String |
userId | String |
emailAddress | String |
salt | String |
hashPassword | String |
description | String |
inactive | Boolean |
apiKey | Boolean |
hasRoot | Boolean |
passwordResetToken | String |
tokenExpirationTime | Long |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.resetUserPassword(userName, newHashPassword);
retVal = baseAPI.doAdmin_ResetUserPassword(userName, newHashPassword);
Entitlement: /admin/main
This method gives an administrator the ability to reset the password of a user. The user will have the new password passed. The newHashPassword parameter should be an MD5 of the new password - internally this will be hashed further against a salt for this user.
Parameter | Type | Description |
---|---|---|
userName | String | |
newHashPassword | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.createPasswordResetToken(username);
retVal = baseAPI.doAdmin_CreatePasswordResetToken(username);
Entitlement: /admin/main
Creates password reset token
Parameter | Type | Description |
---|---|---|
username | String |
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.cancelPasswordResetToken(username);
retVal = baseAPI.doAdmin_CancelPasswordResetToken(username);
Entitlement: /admin/main
Cancels password reset token
Parameter | Type | Description |
---|---|---|
username | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.updateUserEmail(userName, newEmail);
retVal = baseAPI.doAdmin_UpdateUserEmail(userName, newEmail);
Entitlement: /admin/main
This method updates user email.
Parameter | Type | Description |
---|---|---|
userName | String | |
newEmail | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
List<RaptureRemote> retVal = adminApi.getRemotes();
retVal = baseAPI.doAdmin_GetRemotes();
Entitlement: /admin/main
This method lists the remotes created on this system (the connections this system may make to other systems).
This function takes no parameters.
Type | Description |
---|---|
List |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
RaptureRemote retVal = adminApi.addRemote(name, description, url, apiKey, optP);
retVal = baseAPI.doAdmin_AddRemote(name, description, url, apiKey, optP);
Entitlement: /admin/main
Remotes are used to connect one Rapture cloud environment to another. Each remote manages a connection to another Rapture cloudthrough the http api. This method adds a new remote to this system. The apikey is the login name of a user on the remote cloud with adequate entitlements to push and pull thedata to be synchronized or accessed via the remote. The description can be any text to help the human administrators tell clouds apart.The url is the http end point of the remote system.
Parameter | Type | Description |
---|---|---|
name | String | |
description | String | |
url | String | |
apiKey | String | |
optP | String |
Type | Description |
---|---|
RaptureRemote |
Defines a remote instance of Rapture.
Field | Type |
---|---|
name | String |
description | String |
url | String |
apiKey | String |
optionalPass | String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.deleteRemote(name);
retVal = baseAPI.doAdmin_DeleteRemote(name);
Entitlement: /admin/main
This method deletes a previously created remote.
Parameter | Type | Description |
---|---|---|
name | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.updateRemoteApiKey(name, apiKey);
retVal = baseAPI.doAdmin_UpdateRemoteApiKey(name, apiKey);
Entitlement: /admin/main
This method updates the user api key used by a given remote. This is an api key for the remote system, not this Rapture system.
Parameter | Type | Description |
---|---|---|
name | String | |
apiKey | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.setRemote(raptureURI, remote, remoteURI);
retVal = baseAPI.doAdmin_SetRemote(raptureURI, remote, remoteURI);
Entitlement: /admin/main
A remote has been defined it can be used to synchronize one repository with another. This method defines how one (local) repository is connected to a remote type. The binding is made between the combination of a authority, repository and perspective from one system to another. The previously defines remote will hand the synchronization work.
Parameter | Type | Description |
---|---|---|
raptureURI | String | |
remote | String | |
remoteURI | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.clearRemote(raptureURI);
retVal = baseAPI.doAdmin_ClearRemote(raptureURI);
Entitlement: /admin/main
This method reverses a previously defined association between two repositories
Parameter | Type | Description |
---|---|---|
raptureURI | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.pullRemote(raptureURI);
retVal = baseAPI.doAdmin_PullRemote(raptureURI);
Entitlement: /admin/main
If this type has a remote defined, use it to sync this repository with that of the other.
Parameter | Type | Description |
---|---|---|
raptureURI | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.addTemplate(name, template, overwrite);
retVal = baseAPI.doAdmin_AddTemplate(name, template, overwrite);
Entitlement: /admin/main
This function adds a template to the Rapture system. A template is a simple way of registering predefined configs that can be used to automatically generate configs for repositories, queues, and the like. Templates use the popular StringTemplate library for merging values into a text template.
Parameter | Type | Description |
---|---|---|
name | String | |
template | String | |
overwrite | boolean |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.runTemplate(name, parameters);
retVal = baseAPI.doAdmin_RunTemplate(name, parameters);
Entitlement: /admin/main
This method executes a template, replacing parts of the template with the passed parameters to create a new string.
Parameter | Type | Description |
---|---|---|
name | String | |
parameters | String |
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.getTemplate(name);
retVal = baseAPI.doAdmin_GetTemplate(name);
Entitlement: /admin/main
This method returns the definition of a template.
Parameter | Type | Description |
---|---|---|
name | String |
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.copyDocumentRepo(srcAuthority, targAuthority, wipe);
retVal = baseAPI.doAdmin_CopyDocumentRepo(srcAuthority, targAuthority, wipe);
Entitlement: /admin/main
Copies the data from one DocumentRepo to another. The target repository is wiped out before hand if 'wipe' is set to true. The target must already exist when this method is called.
Parameter | Type | Description |
---|---|---|
srcAuthority | String | |
targAuthority | String | |
wipe | boolean |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.addIPToWhiteList(ipAddress);
retVal = baseAPI.doAdmin_AddIPToWhiteList(ipAddress);
Entitlement: /admin/main
Use this method to add an IP address to a white list of allowed IP addresses that can log in to this Rapture environment. Once set only IP addresses in this ipAddress list can access Rapture. By default there are no whitelist IP addresses defined which actually means that all IP addresses are allowed.
Parameter | Type | Description |
---|---|---|
ipAddress | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.removeIPFromWhiteList(ipAddress);
retVal = baseAPI.doAdmin_RemoveIPFromWhiteList(ipAddress);
Entitlement: /admin/main
Use this method to remove an IP address from a white list
Parameter | Type | Description |
---|---|---|
ipAddress | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
List<String> retVal = adminApi.getIPWhiteList();
retVal = baseAPI.doAdmin_GetIPWhiteList();
Entitlement: /admin/main
Use this method to return the IP white list
This function takes no parameters.
Type | Description |
---|---|
List |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.runBatchScript(script);
retVal = baseAPI.doAdmin_RunBatchScript(script);
Entitlement: /admin/main
This method runs a batch script at the target site
Parameter | Type | Description |
---|---|---|
script | String |
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
List<RaptureUser> retVal = adminApi.getAllUsers();
retVal = baseAPI.doAdmin_GetAllUsers();
Entitlement: /admin/main
This method retrieves all of the registered users in the system
This function takes no parameters.
Type | Description |
---|---|
List |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.initiateTypeConversion(raptureURI, newConfig, versionsToKeep);
retVal = baseAPI.doAdmin_InitiateTypeConversion(raptureURI, newConfig, versionsToKeep);
Entitlement: /admin/main
This method kicks off a process that will migrate a DocumentRepo to an alternate config. A temporary type will be created with the new config,the old type will be locked for modifications and then all of the documents in the existing type will be copied to the new type, with the metadata intact.Optionally a number of historical versions will be kept if the source repository (and target) support it. Once all of the data has been copied the configattached to each type will be swapped and the type released for access. The temporary type will then be dropped.
Parameter | Type | Description |
---|---|---|
raptureURI | String | |
newConfig | String | |
versionsToKeep | int |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.putArchiveConfig(raptureURI, config);
retVal = baseAPI.doAdmin_PutArchiveConfig(raptureURI, config);
Entitlement: /admin/main
Set the archive config for a type
Parameter | Type | Description |
---|---|---|
raptureURI | String | |
config | TypeArchiveConfig |
Type | Description |
---|---|
void |
The config used when archiving the data in a type.
Field | Type |
---|---|
authority | String |
typeName | String |
useScript | Boolean |
scriptName | String |
versionsToKeep | Long |
timeRangeToKeepInDays | Long |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
TypeArchiveConfig retVal = adminApi.getArchiveConfig(raptureURI);
retVal = baseAPI.doAdmin_GetArchiveConfig(raptureURI);
Entitlement: /admin/main
Retrieve the archive config for a authority
Parameter | Type | Description |
---|---|---|
raptureURI | String |
Type | Description |
---|---|
TypeArchiveConfig |
The config used when archiving the data in a type.
Field | Type |
---|---|
authority | String |
typeName | String |
useScript | Boolean |
scriptName | String |
versionsToKeep | Long |
timeRangeToKeepInDays | Long |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.deleteArchiveConfig(raptureURI);
retVal = baseAPI.doAdmin_DeleteArchiveConfig(raptureURI);
Entitlement: /admin/main
Delete the archive config for a authority
Parameter | Type | Description |
---|---|---|
raptureURI | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
boolean retVal = adminApi.ping();
retVal = baseAPI.doAdmin_Ping();
Entitlement: /admin/main
A general purpose function that tests (or refreshes) the api connection to Rapture with no side effects.
This function takes no parameters.
Type | Description |
---|---|
boolean |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.addMetadata(values, overwrite);
retVal = baseAPI.doAdmin_AddMetadata(values, overwrite);
Entitlement: /admin/main
This function adds values to the metadata field of the CallingContext. It's used to hold values specific to this connection. Since it's set by the caller the values cannot be considered entirely trusted, and private or secure data such as passwords shouldn't be stored in here. If overwrite is false and an entry already exists then an exception should be thrown
Parameter | Type | Description |
---|---|---|
values | Map<String,String> | |
overwrite | boolean |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.setMOTD(message);
retVal = baseAPI.doAdmin_SetMOTD(message);
Entitlement: /admin/main
Set the MOTD (message of the day) for this environment. Setting to a zero length string implies that there is no message of the day
Parameter | Type | Description |
---|---|---|
message | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.getMOTD();
retVal = baseAPI.doAdmin_GetMOTD();
Entitlement: /admin/main
Retrieve the MOTD
This function takes no parameters.
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.setEnvironmentName(name);
retVal = baseAPI.doAdmin_SetEnvironmentName(name);
Entitlement: /admin/main
Set the name of this environment
Parameter | Type | Description |
---|---|---|
name | String |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.setEnvironmentProperties(properties);
retVal = baseAPI.doAdmin_SetEnvironmentProperties(properties);
Entitlement: /admin/main
Set the properties of this environment. Usually for displaying then name (e.g. BANNER_COLOR)
Parameter | Type | Description |
---|---|---|
properties | Map<String,String> |
Type | Description |
---|---|
void |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.getEnvironmentName();
retVal = baseAPI.doAdmin_GetEnvironmentName();
Entitlement: /admin/main
Get the name of this environment
This function takes no parameters.
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
Map<String,String> retVal = adminApi.getEnvironmentProperties();
retVal = baseAPI.doAdmin_GetEnvironmentProperties();
Entitlement: /admin/main
Get the properties of this environment
This function takes no parameters.
Type | Description |
---|---|
Map<String,String> |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.encode(toEncode);
retVal = baseAPI.doAdmin_Encode(toEncode);
Entitlement: /admin/main
Encode a String using the default encoding mechanism
Parameter | Type | Description |
---|---|---|
toEncode | String |
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.createURI(path, leaf);
retVal = baseAPI.doAdmin_CreateURI(path, leaf);
Entitlement: /admin/main
Create a URI with proper encoding given a path and a leaf. Normal URI characters such as : or / in the path will not be encoded
Parameter | Type | Description |
---|---|---|
path | String | |
leaf | String |
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.createMultipartURI(elements);
retVal = baseAPI.doAdmin_CreateMultipartURI(elements);
Entitlement: /admin/main
Create a URI with proper encoding given a list of elements. The return value will begin with // Each element will be encoded (including all punctuation characters) and the elements joined together separated by /
Parameter | Type | Description |
---|---|---|
elements | List |
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.decode(encoded);
retVal = baseAPI.doAdmin_Decode(encoded);
Entitlement: /admin/main
Decode the supplied String according to the URI encoding/decoding rules
Parameter | Type | Description |
---|---|---|
encoded | String |
Type | Description |
---|---|
String |
HttpAdminApi adminApi = new HttpAdminApi(loginApi);
List<String> retVal = adminApi.findGroupNamesByUser(username);
retVal = baseAPI.doAdmin_FindGroupNamesByUser(username);
Entitlement: /admin/main
Find the groups for a given user and return just the names
Parameter | Type | Description |
---|---|---|
username | String |
Type | Description |
---|---|
List |