Exemplo n.º 1
0
 def get(self):
     entityname = self.get_argument("entityname", "")       
     entityid = self.get_argument("id", "")
     row = entity.getEntity(entityname, entityid)
     print row
     columns = const.entities[entityname]['columns']        
     return self.render("edit.html", entityname=entityname, columns=columns, entity=row)
Exemplo n.º 2
0
def getRole(name, **kwargs):
    '''
    Returns a dictionary of role info.
    '''
    if not name:
        raise TypeError('Name argument is missing')

    uri = 'authentication/roles' 
    try:
        return en.getEntity(uri, name, **kwargs)
    except splunk.ResourceNotFound:
        return {}
Exemplo n.º 3
0
def getRole(name, **kwargs):
    '''
    Returns a dictionary of role info.
    '''
    if not name:
        raise TypeError('Name argument is missing')

    uri = 'authentication/roles'
    try:
        return en.getEntity(uri, name, **kwargs)
    except splunk.ResourceNotFound:
        return {}
def getSavedSearch(label,
                   namespace=None,
                   sessionKey=None,
                   owner=None,
                   hostPath=None,
                   uri=None):
    '''Retrieve a single saved search.'''
    return entity.getEntity(SAVED_SEARCHES_ENDPOINT_ENTITY_PATH,
                            label,
                            namespace=namespace,
                            owner=owner,
                            sessionKey=sessionKey,
                            hostPath=hostPath,
                            uri=uri)
def getSavedSearchWithTimes(label,
                            et,
                            lt,
                            namespace=None,
                            sessionKey=None,
                            owner=None,
                            hostPath=None):
    '''Retrieve a list of UTC times that a saved searches was schedule to run.'''
    return entity.getEntity(SAVED_SEARCHES_ENDPOINT_ENTITY_PATH,
                            label,
                            earliest_time=et,
                            latest_time=lt,
                            namespace=namespace,
                            owner=owner,
                            sessionKey=sessionKey,
                            hostPath=hostPath)
Exemplo n.º 6
0
def getUser(name=None, id=None, **kwargs):
    '''
    Returns a dictionary of user info for a specific user ID.
    '''
    uri = 'authentication/users'
    if name:
        try:
            info = en.getEntity(uri, name, **kwargs)
            info['name'] = name
            return info
        except splunk.ResourceNotFound:
            return None

    elif id:
        raise Exception, 'User IDs are no longer available; all users must be identified by name'
        
    else:
        raise TypeError('No arguments specified')
Exemplo n.º 7
0
def getUser(name=None, id=None, **kwargs):
    '''
    Returns a dictionary of user info for a specific user ID.
    '''
    uri = 'authentication/users'
    if name:
        try:
            info = en.getEntity(uri, name, **kwargs)
            info['name'] = name
            return info
        except splunk.ResourceNotFound:
            return None

    elif id:
        raise Exception, 'User IDs are no longer available; all users must be identified by name'

    else:
        raise TypeError('No arguments specified')
def getSavedSearch(label, namespace=None, sessionKey=None, owner=None, hostPath=None, uri=None):
    '''Retrieve a single saved search.'''
    return entity.getEntity(SAVED_SEARCHES_ENDPOINT_ENTITY_PATH, label, namespace=namespace, owner=owner, sessionKey=sessionKey, hostPath=hostPath, uri=uri)
def getSavedSearchWithTimes(label, et, lt, namespace=None, sessionKey=None, owner=None, hostPath=None):
    '''Retrieve a list of UTC times that a saved searches was schedule to run.'''
    return entity.getEntity(SAVED_SEARCHES_ENDPOINT_ENTITY_PATH, label, earliest_time=et, latest_time=lt, namespace=namespace, owner=owner, sessionKey=sessionKey, hostPath=hostPath)