API admin - RapturePlatform/Rapture GitHub Wiki

Admin API

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.

getSystemProperties

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.

Function Parameters

Parameter Type Description
keys List

Return value

Type Description
Map<String,String>

getRepoConfig

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.

Function Parameters

This function takes no parameters.

Return value

Type Description
List

getSessionsForUser

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.

Function Parameters

Parameter Type Description
user String

Return value

Type Description
List

getTags

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.

Function Parameters

Parameter Type Description
raptureURI String

Return value

Type Description
List

deleteUser

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.

Function Parameters

Parameter Type Description
userName String

Return value

Type Description
void

destroyUser

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

Function Parameters

Parameter Type Description
userName String

Return value

Type Description
void

restoreUser

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

Function Parameters

Parameter Type Description
userName String

Return value

Type Description
void

addUser

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).

Function Parameters

Parameter Type Description
userName String
description String
hashPassword String
email String

Return value

Type Description
void

doesUserExist

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.

Function Parameters

Parameter Type Description
userName String

Return value

Type Description
boolean

getUser

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.

Function Parameters

Parameter Type Description
userName String

Return value

Type Description
RaptureUser
Types used in this function

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

generateApiUser

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.

Function Parameters

Parameter Type Description
prefix String
description String

Return value

Type Description
RaptureUser
Types used in this function

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

resetUserPassword

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.

Function Parameters

Parameter Type Description
userName String
newHashPassword String

Return value

Type Description
void

createPasswordResetToken

HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.createPasswordResetToken(username);
retVal = baseAPI.doAdmin_CreatePasswordResetToken(username);

Entitlement: /admin/main

Creates password reset token

Function Parameters

Parameter Type Description
username String

Return value

Type Description
String

cancelPasswordResetToken

HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.cancelPasswordResetToken(username);
retVal = baseAPI.doAdmin_CancelPasswordResetToken(username);

Entitlement: /admin/main

Cancels password reset token

Function Parameters

Parameter Type Description
username String

Return value

Type Description
void

updateUserEmail

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.

Function Parameters

Parameter Type Description
userName String
newEmail String

Return value

Type Description
void

getRemotes

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).

Function Parameters

This function takes no parameters.

Return value

Type Description
List

addRemote

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.

Function Parameters

Parameter Type Description
name String
description String
url String
apiKey String
optP String

Return value

Type Description
RaptureRemote
Types used in this function

RaptureRemote

Defines a remote instance of Rapture.

Field Type
name String
description String
url String
apiKey String
optionalPass String

deleteRemote

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.

Function Parameters

Parameter Type Description
name String

Return value

Type Description
void

updateRemoteApiKey

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.

Function Parameters

Parameter Type Description
name String
apiKey String

Return value

Type Description
void

setRemote

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.

Function Parameters

Parameter Type Description
raptureURI String
remote String
remoteURI String

Return value

Type Description
void

clearRemote

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

Function Parameters

Parameter Type Description
raptureURI String

Return value

Type Description
void

pullRemote

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.

Function Parameters

Parameter Type Description
raptureURI String

Return value

Type Description
void

addTemplate

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.

Function Parameters

Parameter Type Description
name String
template String
overwrite boolean

Return value

Type Description
void

runTemplate

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.

Function Parameters

Parameter Type Description
name String
parameters String

Return value

Type Description
String

getTemplate

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.

Function Parameters

Parameter Type Description
name String

Return value

Type Description
String

copyDocumentRepo

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.

Function Parameters

Parameter Type Description
srcAuthority String
targAuthority String
wipe boolean

Return value

Type Description
void

addIPToWhiteList

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.

Function Parameters

Parameter Type Description
ipAddress String

Return value

Type Description
void

removeIPFromWhiteList

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

Function Parameters

Parameter Type Description
ipAddress String

Return value

Type Description
void

getIPWhiteList

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

Function Parameters

This function takes no parameters.

Return value

Type Description
List

runBatchScript

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

Function Parameters

Parameter Type Description
script String

Return value

Type Description
String

getAllUsers

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

Function Parameters

This function takes no parameters.

Return value

Type Description
List

initiateTypeConversion

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.

Function Parameters

Parameter Type Description
raptureURI String
newConfig String
versionsToKeep int

Return value

Type Description
void

putArchiveConfig

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

Function Parameters

Parameter Type Description
raptureURI String
config TypeArchiveConfig

Return value

Type Description
void
Types used in this function

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

getArchiveConfig

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

Function Parameters

Parameter Type Description
raptureURI String

Return value

Type Description
TypeArchiveConfig
Types used in this function

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

deleteArchiveConfig

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

Function Parameters

Parameter Type Description
raptureURI String

Return value

Type Description
void

ping

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.

Function Parameters

This function takes no parameters.

Return value

Type Description
boolean

addMetadata

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

Function Parameters

Parameter Type Description
values Map<String,String>
overwrite boolean

Return value

Type Description
void

setMOTD

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

Function Parameters

Parameter Type Description
message String

Return value

Type Description
void

getMOTD

HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.getMOTD();
retVal = baseAPI.doAdmin_GetMOTD();

Entitlement: /admin/main

Retrieve the MOTD

Function Parameters

This function takes no parameters.

Return value

Type Description
String

setEnvironmentName

HttpAdminApi adminApi = new HttpAdminApi(loginApi);
void retVal = adminApi.setEnvironmentName(name);
retVal = baseAPI.doAdmin_SetEnvironmentName(name);

Entitlement: /admin/main

Set the name of this environment

Function Parameters

Parameter Type Description
name String

Return value

Type Description
void

setEnvironmentProperties

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)

Function Parameters

Parameter Type Description
properties Map<String,String>

Return value

Type Description
void

getEnvironmentName

HttpAdminApi adminApi = new HttpAdminApi(loginApi);
String retVal = adminApi.getEnvironmentName();
retVal = baseAPI.doAdmin_GetEnvironmentName();

Entitlement: /admin/main

Get the name of this environment

Function Parameters

This function takes no parameters.

Return value

Type Description
String

getEnvironmentProperties

HttpAdminApi adminApi = new HttpAdminApi(loginApi);
Map<String,String> retVal = adminApi.getEnvironmentProperties();
retVal = baseAPI.doAdmin_GetEnvironmentProperties();

Entitlement: /admin/main

Get the properties of this environment

Function Parameters

This function takes no parameters.

Return value

Type Description
Map<String,String>

encode

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

Function Parameters

Parameter Type Description
toEncode String

Return value

Type Description
String

createURI

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

Function Parameters

Parameter Type Description
path String
leaf String

Return value

Type Description
String

createMultipartURI

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 /

Function Parameters

Parameter Type Description
elements List

Return value

Type Description
String

decode

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

Function Parameters

Parameter Type Description
encoded String

Return value

Type Description
String

findGroupNamesByUser

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

Function Parameters

Parameter Type Description
username String

Return value

Type Description
List
⚠️ **GitHub.com Fallback** ⚠️