client/splunk.js
function(path, namespace) {
            namespace = namespace || {};

            if (utils.startsWith(path, "/")) {
                return path;
            }

            // If we don't have an app name (explicitly or implicitly), we default to /services/
            if (!namespace.app && !this.app && namespace.sharing !== root.Sharing.SYSTEM) {
                return "/services/" + path;
            }

            // Get the app and owner, first from the passed in namespace, then the service,
            // finally defaulting to wild cards
            var owner = namespace.owner || this.owner || "-";
            var app   = namespace.app || this.app || "-";

            namespace.sharing = (namespace.sharing || "").toLowerCase();

            // Modify the owner and app appropriately based on the sharing parameter
            if (namespace.sharing === root.Sharing.APP || namespace.sharing === root.Sharing.GLOBAL) {
                owner = "nobody";
            }
            else if (namespace.sharing === root.Sharing.SYSTEM) {
                owner = "nobody";
                app = "system";
            }

            return utils.trim("/servicesNS/" + encodeURIComponent(owner) + "/" + encodeURIComponent(app) + "/" + path);
        }
function(path, namespace) {
            namespace = namespace || {};

            if (utils.startsWith(path, "/")) {
                return path;
            }

            // If we don't have an app name (explicitly or implicitly), we default to /services/
            if (!namespace.app && !this.app && namespace.sharing !== root.Sharing.SYSTEM) {
                return "/services/" + path;
            }

            // Get the app and owner, first from the passed in namespace, then the service,
            // finally defaulting to wild cards
            var owner = namespace.owner || this.owner || "-";
            var app   = namespace.app || this.app || "-";

            namespace.sharing = (namespace.sharing || "").toLowerCase();

            // Modify the owner and app appropriately based on the sharing parameter
            if (namespace.sharing === root.Sharing.APP || namespace.sharing === root.Sharing.GLOBAL) {
                owner = "nobody";
            }
            else if (namespace.sharing === root.Sharing.SYSTEM) {
                owner = "nobody";
                app = "system";
            }

            return utils.trim("/servicesNS/" + encodeURIComponent(owner) + "/" + encodeURIComponent(app) + "/" + path);
        }
function ( path , namespace ) { namespace = namespace || { } ; if ( utils . startsWith ( path , "/" ) ) { return path ; } // If we don't have an app name (explicitly or implicitly), we default to /services/ if ( ! namespace . app && ! this . app && namespace . sharing !== root . Sharing . SYSTEM ) { return "/services/" + path ; } // Get the app and owner, first from the passed in namespace, then the service, // finally defaulting to wild cards var owner = namespace . owner || this . owner || "-" ; var app = namespace . app || this . app || "-" ; namespace . sharing = ( namespace . sharing || "" ) . toLowerCase ( ) ; // Modify the owner and app appropriately based on the sharing parameter if ( namespace . sharing === root . Sharing . APP || namespace . sharing === root . Sharing . GLOBAL ) { owner = "nobody" ; } else if ( namespace . sharing === root . Sharing . SYSTEM ) { owner = "nobody" ; app = "system" ; } return utils . trim ( "/servicesNS/" + encodeURIComponent ( owner ) + "/" + encodeURIComponent ( app ) + "/" + path ) ; }
Converts a partial path to a fully-qualified path to a REST endpoint,
and if necessary includes the namespace owner and app.

@param {String} path The partial path.
@param {String} namespace The namespace, in the format "_owner_/_app_".
@return {String} The fully-qualified path.

@method splunkjs.Context
Converts a partial path to a fully - qualified path to a REST endpoint and if necessary includes the namespace owner and app .