com.splunk
Class Role

java.lang.Object
  extended by com.splunk.Resource
      extended by com.splunk.Entity
          extended by com.splunk.Role
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>

public class Role
extends Entity

The Role class represents a Splunk role, which is a collection of permissions and capabilities. The user's role determines what the user can see and interact with in Splunk.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.splunk.Entity
content, toUpdate
 
Fields inherited from class com.splunk.Resource
actions, path, refreshArgs, service, title
 
Method Summary
 java.lang.String[] getCapabilities()
          Returns an array of capabilities assigned to this role.
 java.lang.String getDefaultApp()
          Returns the app to use as the default app for this role.
 java.lang.String[] getImportedCapabilities()
          Returns an array of capabilities imported for this role.
 java.lang.String[] getImportedIndexesAllowed()
          Returns an array of indexes that a user with this role has permissions to search.
 java.lang.String[] getImportedIndexesDefault()
          Returns an array of indexes to search by default when no index is specified for a user with this role.
 int getImportedRealTimeSearchJobsQuota()
          Returns the maximum number of concurrent real-time search jobs a user with this role is allowed to run.
 java.lang.String[] getImportedRoles()
          Returns an array of roles to import attributes from, such as capabilities and allowed indexes to search.
 int getImportedRtSearchJobsQuota()
          Deprecated. Use getImportedRealTimeSearchJobsQuota() instead.
 int getImportedSearchDiskQuota()
          Returns the maximum disk space that can be used for search jobs by a user with this role.
 java.lang.String getImportedSearchFilter()
          Returns a search string that restricts the scope of searches run by this role.
 int getImportedSearchJobsQuota()
          Returns the maximum number of concurrent searches a user with this role is allowed to run.
 int getImportedSearchTimeWindow()
          Returns the maximum time span of a search, in seconds.
 int getRealTimeSearchJobsQuota()
          Returns the maximum number of concurrent real-time search jobs a user with this role is allowed to run.
 int getRtSearchJobsQuota()
          Deprecated. Use getRealTimeSearchJobsQuota() instead.
 int getSearchDiskQuota()
          Returns the maximum disk space that can be used for search jobs by a user with this role.
 java.lang.String getSearchFilter()
          Returns a search string that restricts the scope of searches run by this role.
 java.lang.String[] getSearchIndexesAllowed()
          Returns an array of indexes that a user with this role has permissions to search.
 java.lang.String[] getSearchIndexesDefault()
          Returns an array of indexes to search by default when no index is specified for a user with this role.
 int getSearchJobsQuota()
          Returns the maximum number of concurrent searches a user with this role is allowed to run.
 int getSearchTimeWin()
          Deprecated. Use getSearchTimeWindow() instead.
 int getSearchTimeWindow()
          Returns the maximum time span of a search that is allowed for users in this role.
 void setCapabilities(java.lang.String capability)
          Assigns a single capability to this role.
 void setCapabilities(java.lang.String[] capabilities)
          Assigns an array of capabilities to this role.
 void setDefaultApp(java.lang.String defaultApp)
          Sets the default app for this role.
 void setImportedRoles(java.lang.String importedRole)
          Sets a role to import attributes from, such as capabilities and allowed indexes to search.
 void setImportedRoles(java.lang.String[] importedRoles)
          Sets a list of roles to import attributes from, such as capabilities and allowed indexes to search.
 void setRealTimeSearchJobsQuota(int numJobs)
          Sets the maximum number of concurrent real-time search jobs a user with this role is allowed to run.
 void setSearchDiskQuota(int srchDiskQuota)
          Sets the maximum disk space that can be used for search jobs by a user with this role.
 void setSearchFilter(java.lang.String srchFilter)
          Sets a search string that restricts the scope of searches run by this role.
 void setSearchIndexesAllowed(java.lang.String indexAllowed)
          Sets the index that a user with this role has permissions to search.
 void setSearchIndexesAllowed(java.lang.String[] indexesAllowed)
          Sets the indexes that a user with this role has permissions to search.
 void setSearchIndexesDefault(java.lang.String srchIndexDefault)
          Sets the index to search by default when no index is specified for a user with this role.
 void setSearchIndexesDefault(java.lang.String[] srchIndexesDefault)
          Sets the indexes to search by default when no index is specified for a user with this role.
 void setSearchJobsQuota(int srchJobsQuota)
          Sets the maximum number of concurrent searches a user with this role is allowed to run.
 void setSearchTimeWindow(int srchTimeWin)
          Sets the maximum time span of a search that is allowed for users in this role.
 
Methods inherited from class com.splunk.Entity
actionPath, clear, containsKey, containsValue, disable, enable, entrySet, get, getContent, getMetadata, isDisabled, isEmpty, isNameChangeAllowed, keySet, put, putAll, refresh, remove, remove, size, update, update, validate, values
 
Methods inherited from class com.splunk.Resource
getName, getPath, getService, getTitle, invalidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Method Detail

getCapabilities

public java.lang.String[] getCapabilities()
Returns an array of capabilities assigned to this role.

Returns:
An array of capabilities.

getDefaultApp

public java.lang.String getDefaultApp()
Returns the app to use as the default app for this role. The user can override this setting.

Returns:
The default app for this role.

getImportedCapabilities

public java.lang.String[] getImportedCapabilities()
Returns an array of capabilities imported for this role.

Returns:
An array of imported capabilities.

getImportedRoles

public java.lang.String[] getImportedRoles()
Returns an array of roles to import attributes from, such as capabilities and allowed indexes to search.

Returns:
An array of imported roles.

getImportedRtSearchJobsQuota

public int getImportedRtSearchJobsQuota()
Deprecated. Use getImportedRealTimeSearchJobsQuota() instead.

Returns the maximum number of concurrent real-time search jobs a user with this role is allowed to run.

Returns:
The imported quota for real-time search jobs.

getImportedRealTimeSearchJobsQuota

public int getImportedRealTimeSearchJobsQuota()
Returns the maximum number of concurrent real-time search jobs a user with this role is allowed to run.

Returns:
The imported quota for real-time search jobs.

getImportedSearchDiskQuota

public int getImportedSearchDiskQuota()
Returns the maximum disk space that can be used for search jobs by a user with this role.

Returns:
The imported search disk quota, in megabytes.

getImportedSearchFilter

public java.lang.String getImportedSearchFilter()
Returns a search string that restricts the scope of searches run by this role. Only those events that also match this search string are shown to the user. If a user has multiple roles with different search filters, they are combined with an OR.

Returns:
The imported search filter.

getImportedIndexesAllowed

public java.lang.String[] getImportedIndexesAllowed()
Returns an array of indexes that a user with this role has permissions to search.

Returns:
The imported array of allowed indexes.

getImportedIndexesDefault

public java.lang.String[] getImportedIndexesDefault()
Returns an array of indexes to search by default when no index is specified for a user with this role.

Returns:
The imported array of default indexes.

getImportedSearchJobsQuota

public int getImportedSearchJobsQuota()
Returns the maximum number of concurrent searches a user with this role is allowed to run.

Returns:
The imported quota for normal search jobs.

getImportedSearchTimeWindow

public int getImportedSearchTimeWindow()
Returns the maximum time span of a search, in seconds.

Returns:
The maximum time span of a search, in seconds.

getRtSearchJobsQuota

public int getRtSearchJobsQuota()
Deprecated. Use getRealTimeSearchJobsQuota() instead.

Returns the maximum number of concurrent real-time search jobs a user with this role is allowed to run.

Returns:
Maximum number of concurrent real-time search jobs.

getRealTimeSearchJobsQuota

public int getRealTimeSearchJobsQuota()
Returns the maximum number of concurrent real-time search jobs a user with this role is allowed to run.

Returns:
Maximum number of concurrent real-time search jobs.

getSearchDiskQuota

public int getSearchDiskQuota()
Returns the maximum disk space that can be used for search jobs by a user with this role.

Returns:
Maximum disk space usage, in megabytes.

getSearchFilter

public java.lang.String getSearchFilter()
Returns a search string that restricts the scope of searches run by this role. Only those events that also match this search string are shown to the user. If a user has multiple roles with different search filters, they are combined with an OR.

Returns:
The search filter.

getSearchIndexesAllowed

public java.lang.String[] getSearchIndexesAllowed()
Returns an array of indexes that a user with this role has permissions to search.

Returns:
An array of allowed indexes.

getSearchIndexesDefault

public java.lang.String[] getSearchIndexesDefault()
Returns an array of indexes to search by default when no index is specified for a user with this role.

Returns:
An array of default indexes.

getSearchJobsQuota

public int getSearchJobsQuota()
Returns the maximum number of concurrent searches a user with this role is allowed to run.

Returns:
The quota for normal search jobs.

getSearchTimeWin

public int getSearchTimeWin()
Deprecated. Use getSearchTimeWindow() instead.

Returns the maximum time span of a search that is allowed for users in this role.

Returns:
Maximum time span of a search, in seconds.

getSearchTimeWindow

public int getSearchTimeWindow()
Returns the maximum time span of a search that is allowed for users in this role.

Returns:
Maximum time span of a search, in seconds.

setCapabilities

public void setCapabilities(java.lang.String[] capabilities)
Assigns an array of capabilities to this role. For a list of possible capabilities, see Capabilities on dev.splunk.com.

Parameters:
capabilities - An array of capabilities.

setCapabilities

public void setCapabilities(java.lang.String capability)
Assigns a single capability to this role. For a list of possible capabilities, see Capabilities on dev.splunk.com.

Parameters:
capability - The capability to set.

setDefaultApp

public void setDefaultApp(java.lang.String defaultApp)
Sets the default app for this role.

Parameters:
defaultApp - The default app (the name of the folder that contains the app).

setImportedRoles

public void setImportedRoles(java.lang.String[] importedRoles)
Sets a list of roles to import attributes from, such as capabilities and allowed indexes to search. In combining multiple roles, the effective value for each attribute is the value with the broadest permissions.

Default Splunk roles are:

You also can specify additional roles that have been created.

Parameters:
importedRoles - An array of roles from which to import attributes.

setImportedRoles

public void setImportedRoles(java.lang.String importedRole)
Sets a role to import attributes from, such as capabilities and allowed indexes to search. Use this method to set a single role.

Importing other roles imports all aspects of that role, such as capabilities and allowed indexes to search.

Default Splunk roles are:

You also can specify additional roles that have been created.

Parameters:
importedRole - A role from which to import attributes.

setRealTimeSearchJobsQuota

public void setRealTimeSearchJobsQuota(int numJobs)
Sets the maximum number of concurrent real-time search jobs a user with this role is allowed to run. This count is independent from the normal search jobs limit.

Parameters:
numJobs - The maximum number of real-time search jobs.

setSearchDiskQuota

public void setSearchDiskQuota(int srchDiskQuota)
Sets the maximum disk space that can be used for search jobs by a user with this role.

Parameters:
srchDiskQuota - The maximum disk space to allocate, in megabytes.

setSearchFilter

public void setSearchFilter(java.lang.String srchFilter)
Sets a search string that restricts the scope of searches run by this role. Search results for this role only show events that also match the search string you specify. In the case that a user has multiple roles with different search filters, they are combined with an OR.

Parameters:
srchFilter - The restrictive search string.

setSearchIndexesAllowed

public void setSearchIndexesAllowed(java.lang.String[] indexesAllowed)
Sets the indexes that a user with this role has permissions to search.

Parameters:
indexesAllowed - An array of allowed indexes.

setSearchIndexesAllowed

public void setSearchIndexesAllowed(java.lang.String indexAllowed)
Sets the index that a user with this role has permissions to search. Use this method to set a single index.

Parameters:
indexAllowed - The allowed index.

setSearchIndexesDefault

public void setSearchIndexesDefault(java.lang.String[] srchIndexesDefault)
Sets the indexes to search by default when no index is specified for a user with this role.

Parameters:
srchIndexesDefault - An array of default indexes.

setSearchIndexesDefault

public void setSearchIndexesDefault(java.lang.String srchIndexDefault)
Sets the index to search by default when no index is specified for a user with this role. Use this method to set a single default index.

Parameters:
srchIndexDefault - The default index.

setSearchJobsQuota

public void setSearchJobsQuota(int srchJobsQuota)
Sets the maximum number of concurrent searches a user with this role is allowed to run. In the event of many roles per user, the maximum of these quotas is applied.

Parameters:
srchJobsQuota - The maximum number of concurrent jobs.

setSearchTimeWindow

public void setSearchTimeWindow(int srchTimeWin)
Sets the maximum time span of a search that is allowed for users in this role.

Parameters:
srchTimeWin - The maximum time span of a search, in seconds.