Application Framework Reference

Model API

build_id()

The build_id() method generates an ID string from the specified object name and the resource URI path defined in the model.

Synopsis

resId = build_id( name, namespace, owner )

Parameters

name

String

Entity name.

namespace

String

Entity namespace, or application name.

owner

String

Entity owner.

Return Value

String

Hierarchical URI path to the requested entity in the REST API.

Examples

Example 1
from splunk.models.base  import SplunkRESTModel
class MyAppModel(SplunkRESTModel):

    try:
        id = MyAppModel.build_id(name='newsearch', namespace='search', owner='admin')
    except:
        raise
 
Example 2

Without build_id():

    form_content[key] = EventType.get('/servicesNS/%s/%s/saved/eventtypes/%s' %\
                                      (user, 'webintelligence', key))
 

Alternative using build_id():

et = Eventtype.build_id(key, 'webintelligence', user)
form_content[key] = EventType.get(et)
 

See Also

get()