## Methods

### cancel

##### splunkjs.Service.Job.cancel

##### Endpoint: search/jobs/{search_id}/control

Cancels a search job.

#### Syntax

cancel: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call when the search is done: `(err)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.cancel(function(err) {
         console.log("CANCELLED");
     });

#### Source (lib/service.js:2607)

    cancel: function(callback) {
        var req = this.post("control", {action: "cancel"}, callback);

        return req;
    },

### disablePreview

##### splunkjs.Service.Job.disablePreview

##### Endpoint: search/jobs/{search_id}/control

Disables preview generation for a search job.

#### Syntax

disablePreview: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call with this search job: `(err, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.disablePreview(function(err, job) {
         console.log("PREVIEW DISABLED");
     });

#### Source (lib/service.js:2628)

    disablePreview: function(callback) {
        callback = callback || function() {};

        var that = this;
        var req = this.post("control", {action: "disablepreview"}, function(err) {
            callback(err, that);
        });

        return req;
    },

### enablePreview

##### splunkjs.Service.Job.enablePreview

##### Endpoint: search/jobs/{search_id}/control

Enables preview generation for a search job.

#### Syntax

enablePreview: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call with this search job: `(err, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.disablePreview(function(err, job) {
         console.log("PREVIEW ENABLED");
     });

#### Source (lib/service.js:2654)

    enablePreview: function(callback) {
        callback = callback || function() {};

        var that = this;
        var req = this.post("control", {action: "enablepreview"}, function(err) {
            callback(err, that);
        });

        return req;
    },

### events

##### splunkjs.Service.Job.events

##### Endpoint: search/jobs/{search_id}/events

Returns the events of a search job with given parameters.

#### Syntax

events: function(params, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
params | Object | The parameters for retrieving events. For a list of available parameters, see the GET search/jobs/{search_id}/events endpoint in the REST API documentation.
callback | Function | A function to call when the events are retrieved: `(err, events, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.events({count: 10}, function(err, events, job) {
         console.log("Fields: ", events.fields);
     });

#### Source (lib/service.js:2681)

    events: function(params, callback) {
        callback = callback || function() {};
        params = params || {};
        params.output_mode = params.output_mode || "json_rows";

        var that = this;
        return this.get("events", params, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                callback(null, response.data, that);
            }
        });
    },

### finalize

##### splunkjs.Service.Job.finalize

##### Endpoint: search/jobs/{search_id}/control

Finalizes a search job.

#### Syntax

finalize: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call with the job: `(err, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.finalize(function(err, job) {
         console.log("JOB FINALIZED");
     });

#### Source (lib/service.js:2712)

    finalize: function(callback) {
        callback = callback || function() {};

        var that = this;
        var req = this.post("control", {action: "finalize"}, function(err) {
            callback(err, that);
        });

        return req;
    },

### init

##### splunkjs.Service.Job.init

Constructor for `splunkjs.Service.Job`.

#### Syntax

init: function(service, sid, namespace)

#### Parameters

Name | Type | Description
--- | --- | ---
service | splunkjs.Service | A `Service` instance.
sid | String | The search ID for this search job.
namespace | Object | Namespace information: - `owner` (string): The Splunk username, such as "admin". A value of "nobody" means no specific user. The "-" wildcard means all users. - `app` (string): The app context for this resource (such as "search"). The "-" wildcard means all apps. - `sharing` (string): A mode that indicates how the resource is shared. The sharing mode can be "user", "app", "global", or "system".

#### Return

splunkjs.Service.Job.

A new `splunkjs.Service.Job` instance.

#### Source (lib/service.js:2568)

    init: function(service, sid, namespace) {
        this.name = sid;
        this._super(service, this.path(), namespace);
        this.sid = sid;
        // We perform the bindings so that every function works
        // properly when it is passed as a callback.
        this.cancel         = utils.bind(this, this.cancel);
        this.disablePreview = utils.bind(this, this.disablePreview);
        this.enablePreview  = utils.bind(this, this.enablePreview);
        this.events         = utils.bind(this, this.events);
        this.finalize       = utils.bind(this, this.finalize);
        this.pause          = utils.bind(this, this.pause);
        this.preview        = utils.bind(this, this.preview);
        this.results        = utils.bind(this, this.results);
        this.searchlog      = utils.bind(this, this.searchlog);
        this.setPriority    = utils.bind(this, this.setPriority);
        this.setTTL         = utils.bind(this, this.setTTL);
        this.summary        = utils.bind(this, this.summary);
        this.timeline       = utils.bind(this, this.timeline);
        this.touch          = utils.bind(this, this.touch);
        this.unpause        = utils.bind(this, this.unpause);
    },

### iterator

##### splunkjs.Service.Job.iterator

##### Endpoint: search/jobs/{search_id}/results

Returns an iterator over this search job's events or results.

#### Syntax

iterator: function(type, params)

#### Parameters

Name | Type | Description
--- | --- | ---
type | String | One of {"events", "preview", "results"}.
params | Object | A dictionary of optional parameters: - `pagesize` (integer): The number of items to return on each request. Defaults to as many as possible.

#### Return

Object.

An iterator object with a `next(callback)` method, where `callback` is of the form `(err, results, hasMoreResults)`.

#### Source (lib/service.js:2734)

    iterator: function(type, params) {
        return new root.PaginatedEndpointIterator(this[type], params);
    },

### path

##### splunkjs.Service.Job.path

Retrieves the REST endpoint path for this resource (with no namespace).

#### Syntax

path: function()

#### Source (lib/service.js:2550)

    path: function() {
        return Paths.jobs + "/" + encodeURIComponent(this.name);
    },

### pause

##### splunkjs.Service.Job.pause

##### Endpoint: search/jobs/{search_id}/control

Pauses a search job.

#### Syntax

pause: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call with the job: `(err, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.pause(function(err, job) {
         console.log("JOB PAUSED");
     });

#### Source (lib/service.js:2753)

    pause: function(callback) {
        callback = callback || function() {};

        var that = this;
        var req = this.post("control", {action: "pause"}, function(err) {
            callback(err, that);
        });

        return req;
    },

### preview

##### splunkjs.Service.Job.preview

##### Endpoint: search/jobs/{search_id}/results_preview

Gets the preview results for a search job with given parameters.

#### Syntax

preview: function(params, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
params | Object | The parameters for retrieving preview results. For a list of available parameters, see the GET search/jobs/{search_id}/results_preview endpoint in the REST API documentation.
callback | Function | A function to call when the preview results are retrieved : `(err, results, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.preview({count: 10}, function(err, results, job) {
         console.log("Fields: ", results.fields);
     });

#### Source (lib/service.js:2780)

    preview: function(params, callback) {
        callback = callback || function() {};
        params = params || {};
        params.output_mode = params.output_mode || "json_rows";

        var that = this;
        return this.get("results_preview", params, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                callback(null, response.data, that);
            }
        });
    },

### results

##### splunkjs.Service.Job.results

##### Endpoint: search/jobs/{search_id}/results

Gets the results for a search job with given parameters.

The callback can get `undefined` for its `results` parameter if the job is not yet done. To avoid this, use the `Job.track()` method to wait until the job is complete prior to fetching the results with this method.

#### Syntax

results: function(params, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
params | Object | The parameters for retrieving search results. For a list of available parameters, see the GET search/jobs/{search_id}/results endpoint in the REST API documentation.
callback | Function | A function to call when the results are retrieved: `(err, results, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.results({count: 10}, function(err, results, job) {
         console.log("Fields: ", results.results);
     });

#### Source (lib/service.js:2817)

    results: function(params, callback) {
        callback = callback || function() {};
        params = params || {};
        params.output_mode = params.output_mode || "json_rows";

        var that = this;
        return this.get("results", params, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                callback(null, response.data, that);
            }
        });
    },

### searchlog

##### splunkjs.Service.Job.searchlog

##### Endpoint: search/jobs/{search_id}/search.log

Gets the search log for this search job.

#### Syntax

searchlog: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call with the search log and job: `(err, searchlog, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.searchlog(function(err, searchlog, job) {
         console.log(searchlog);
     });

#### Source (lib/service.js:2848)

    searchlog: function(callback) {
        callback = callback || function() {};

        var that = this;
        return this.get("search.log", {}, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                callback(null, response.data, that);
            }
        });
    },

### setPriority

##### splunkjs.Service.Job.setPriority

##### Endpoint: search/jobs/{search_id}/control

Sets the priority for this search job.

#### Syntax

setPriority: function(value, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
value | Number | The priority (an integer between 1-10). A higher value means a higher priority.
callback | Function | A function to call with the search job: `(err, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.setPriority(6, function(err, job) {
         console.log("JOB PRIORITY SET");
     });

#### Source (lib/service.js:2878)

    setPriority: function(value, callback) {
        callback = callback || function() {};

        var that = this;
        var req = this.post("control", {action: "setpriority", priority: value}, function(err) {
            callback(err, that);
        });

        return req;
    },

### setTTL

##### splunkjs.Service.Job.setTTL

##### Endpoint: search/jobs/{search_id}/control

Sets the time to live (TTL) for the search job, which is the time before the search job expires after it has been completed and is still available.

#### Syntax

setTTL: function(value, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
value | Number | The time to live, in seconds.
callback | Function | A function to call with the search job: `(err, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.setTTL(1000, function(err, job) {
         console.log("JOB TTL SET");
     });

#### Source (lib/service.js:2906)

    setTTL: function(value, callback) {
        callback = callback || function() {};

        var that = this;
        var req = this.post("control", {action: "setttl", ttl: value}, function(err) {
            callback(err, that);
        });

        return req;
    },

### summary

##### splunkjs.Service.Job.summary

##### Endpoint: search/jobs/{search_id}/summmary

Gets the summary for this search job with the given parameters.

#### Syntax

summary: function(params, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
params | Object | The parameters for retrieving the summary. For a list of available parameters, see the GET search/jobs/{search_id}/summary endpoint in the REST API documentation.
callback | Function | A function to call with the summary and search job: `(err, summary, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.summary({top_count: 5}, function(err, summary, job) {
         console.log("Summary: ", summary);
     });

#### Source (lib/service.js:2933)

    summary: function(params, callback) {
        callback = callback || function() {};

        var that = this;
        return this.get("summary", params, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                callback(null, response.data, that);
            }
        });
    },

### timeline

##### splunkjs.Service.Job.timeline

##### Endpoint: search/jobs/{search_id}/timeline

Gets the timeline for this search job.

#### Syntax

timeline: function(params, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
params | Object | The parameters for retrieving the timeline. For a list of available parameters, see the GET search/jobs/{search_id}/timeline endpoint in the REST API documentation.
callback | Function | A function to call with the timeline and search job: `(err, timeline, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.timeline({time_format: "%c"}, function(err, job, timeline) {
         console.log("Timeline: ", timeline);
     });

#### Source (lib/service.js:2963)

    timeline: function(params, callback) {
        callback = callback || function() {};

        var that = this;
        return this.get("timeline", params, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                callback(null, response.data, that);
            }
        });
    },

### touch

##### splunkjs.Service.Job.touch

##### Endpoint: search/jobs/{search_id}/control

Touches a search job, which means extending the expiration time of the search to now plus the time to live (TTL).

#### Syntax

touch: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call with the search job: `(err, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.touch(function(err) {
         console.log("JOB TOUCHED");
     });

#### Source (lib/service.js:2993)

    touch: function(callback) {
        callback = callback || function() {};

        var that = this;
        var req = this.post("control", {action: "touch"}, function(err) {
            callback(err, that);
        });

        return req;
    },

### track

##### splunkjs.Service.Job.track

Starts polling the status of this search job, and fires callbacks upon each status change.

#### Syntax

track: function(options, callbacks)

#### Parameters

Name | Type | Description
--- | --- | ---
options | Object | A dictionary of optional parameters: - `period` (integer): The number of milliseconds to wait between each poll. Defaults to 500.
callbacks | Object,Function | A dictionary of optional callbacks: - `ready`: A function `(job)` invoked when the job's properties first become available. - `progress`: A function `(job)` invoked whenever new job properties are available. - `done`: A function `(job)` invoked if the job completes successfully. No further polling is done. - `failed`: A function `(job)` invoked if the job fails executing on the server. No further polling is done. - `error`: A function `(err)` invoked if an error occurs while polling. No further polling is done. Or, if a function `(job)`, equivalent to passing it as a `done` callback.

#### Source (lib/service.js:3020)

    track: function(options, callbacks) {
        var period = options.period || 500; // ms

        if (utils.isFunction(callbacks)) {
            callbacks = {
                done: callbacks
            };
        }

        var noCallbacksAfterReady = (
            !callbacks.progress &&
            !callbacks.done &&
            !callbacks.failed &&
            !callbacks.error
        );

        callbacks.ready = callbacks.ready || function() {};
        callbacks.progress = callbacks.progress || function() {};
        callbacks.done = callbacks.done || function() {};
        callbacks.failed = callbacks.failed || function() {};
        callbacks.error = callbacks.error || function() {};

        // For use by tests only
        callbacks._preready = callbacks._preready || function() {};
        callbacks._stoppedAfterReady = callbacks._stoppedAfterReady || function() {};

        var that = this;
        var emittedReady = false;
        var doneLooping = false;
        Async.whilst(
            function() { return !doneLooping; },
            function(nextIteration) {
                that.fetch(function(err, job) {
                    if (err) {
                        nextIteration(err);
                        return;
                    }

                    var notReady = (job.properties().isDone === undefined);
                    if (notReady) {
                        callbacks._preready(job);
                    }
                    else {
                        if (!emittedReady) {
                            callbacks.ready(job);
                            emittedReady = true;

                            // Optimization: Don't keep polling the job if the
                            // caller only cares about the `ready` event.
                            if (noCallbacksAfterReady) {
                                callbacks._stoppedAfterReady(job);

                                doneLooping = true;
                                nextIteration();
                                return;
                            }
                        }

                        callbacks.progress(job);

                        var props = job.properties();
                        var dispatchState = props.dispatchState;

                        if (dispatchState === "DONE" && props.isDone) {
                            callbacks.done(job);

                            doneLooping = true;
                            nextIteration();
                            return;
                        }
                        else if (dispatchState === "FAILED" && props.isFailed) {
                            callbacks.failed(job);

                            doneLooping = true;
                            nextIteration();
                            return;
                        }
                    }

                    Async.sleep(period, nextIteration);
                });
            },
            function(err) {
                if (err) {
                    callbacks.error(err);
                }
            }
        );
    },

### unpause

##### splunkjs.Service.Job.unpause

##### Endpoint: search/jobs/{search_id}/control

Resumes a search job.

#### Syntax

unpause: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call with the search job: `(err, job)`.

#### Examples

     var job = service.jobs().item("mysid");
     job.unpause(function(err) {
         console.log("JOB UNPAUSED");
     });

#### Source (lib/service.js:3125)

    unpause: function(callback) {
            callback = callback || function() {};

            var that = this;
            var req = this.post("control", {action: "unpause"}, function(err) {
                callback(err, that);
            });

            return req;
        }
    });

## Inherited Methods

### _load

##### splunkjs.Service.Entity._load

Loads the entity and stores the properties.

#### Syntax

_load: function(properties)

#### Parameters

Name | Type | Description
--- | --- | ---
properties | Object | The properties for this entity.

#### Source (lib/service.js:882)

    _load: function(properties) {
        properties = utils.isArray(properties) ? properties[0] : properties;

        // Initialize the properties to
        // empty values
        properties = properties || {
            content: {},
            fields: {},
            acl: {},
            links: {}
        };

        this._super(properties);

        // Take out the entity-specific content
        this._properties = properties.content   || {};
        this._fields     = properties.fields    || this._fields || {};
        this._acl        = properties.acl       || {};
        this._links      = properties.links     || {};
        this._author     = properties.author    || null;
        this._updated    = properties.updated   || null;
        this._published  = properties.published || null;
    },

### acl

##### splunkjs.Service.Entity.acl

Retrieves the access control list (ACL) information for this entity, which contains the permissions for accessing the entity.

#### Syntax

acl: function()

#### Return

Object.

The ACL.

#### Source (lib/service.js:926)

    acl: function() {
        return this._acl;
    },

### author

##### splunkjs.Service.Entity.author

Retrieves the author information for this entity.

#### Syntax

author: function()

#### Return

String.

The author.

#### Source (lib/service.js:949)

    author: function() {
        return this._author;
    },

### del

##### splunkjs.Service.Endpoint.del

Performs a relative DELETE request on an endpoint's path, combined with the parameters and a relative path if specified.

#### Syntax

del: function(relpath, params, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
relpath | String | A relative path to append to the endpoint path.
params | Object | A dictionary of entity-specific parameters to add to the query string.
callback | Function | A function to call when the request is complete: `(err, response)`.

#### Examples

     // Will make a request to {service.prefix}/search/jobs/123456
     var endpoint = new splunkjs.Service.Endpoint(service, "search/jobs/12345");
     endpoint.delete("", {}, function() { console.log("DELETED"))});

#### Source (lib/service.js:695)

    del: function(relpath, params, callback) {
            var url = this.qualifiedPath;
            // If we have a relative path, we will append it with a preceding
            // slash.
            if (relpath) {
                url = url + "/" + relpath;
            }
            return this.service.del(
                url,
                params,
                callback
            );
        }
    });

### disable

##### splunkjs.Service.Entity.disable

Disables the entity on the server.

#### Syntax

disable: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call when the object is disabled: `(err, entity)`.

#### Source (lib/service.js:1076)

    disable: function(callback) {
        callback = callback || function() {};

        var that = this;
        this.post("disable", {}, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                callback(null, that);
            }
        });
    },

### enable

##### splunkjs.Service.Entity.enable

Enables the entity on the server.

#### Syntax

enable: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call when the object is enabled: `(err, entity)`.

#### Source (lib/service.js:1098)

    enable: function(callback) {
        callback = callback || function() {};

        var that = this;
        this.post("enable", {}, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                callback(null, that);
            }
        });
    },

### fetch

##### splunkjs.Service.Entity.fetch

Refreshes the entity by fetching the object from the server and loading it.

#### Syntax

fetch: function(options, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
options | Object | An optional dictionary of collection filtering and pagination options: - `count` (integer): The maximum number of items to return. - `offset` (integer): The offset of the first item to return. - `search` (string): The search query to filter responses. - `sort_dir` (string): The direction to sort returned items: “asc” or “desc”. - `sort_key` (string): The field to use for sorting (optional). - `sort_mode` (string): The collating sequence for sorting returned items: “auto”, “alpha”, “alpha_case”, or “num”.
callback | Function | A function to call when the object is retrieved: `(err, resource)`.

#### Source (lib/service.js:990)

    fetch: function(options, callback) {
        if (!callback && utils.isFunction(options)) {
            callback = options;
            options = {};
        }
        callback = callback || function() {};

        options = options || {};

        var that = this;
        return this.get("", options, function(err, response) {
            if (err) {
                callback(err);
            }
            else {
                that._load(response.data ? response.data.entry : null);
                callback(null, that);
            }
        });
    },

### fetchOnUpdate

##### splunkjs.Service.Entity.fetchOnUpdate

A static property that indicates whether to call `fetch` after an update to get the updated entity. By default, the entity is not fetched because the endpoint returns (echoes) the updated entity.

#### Source (lib/service.js:832)

    fetchOnUpdate: false,

### fields

##### splunkjs.Service.Entity.fields

Retrieves the fields information for this entity, indicating which fields are wildcards, required, and optional.

#### Syntax

fields: function()

#### Return

Object.

The fields information.

#### Source (lib/service.js:914)

    fields: function() {
        return this._fields;
    },

### get

##### splunkjs.Service.Endpoint.get

Performs a relative GET request on an endpoint's path, combined with the parameters and a relative path if specified.

#### Syntax

get: function(relpath, params, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
relpath | String | A relative path to append to the endpoint path.
params | Object | A dictionary of entity-specific parameters to add to the query string.
callback | Function | A function to call when the request is complete: `(err, response)`.

#### Examples

     // Will make a request to {service.prefix}/search/jobs/123456/results?offset=1
     var endpoint = new splunkjs.Service.Endpoint(service, "search/jobs/12345");
     endpoint.get("results", {offset: 1}, function() { console.log("DONE"))});

#### Source (lib/service.js:631)

    get: function(relpath, params, callback) {
        var url = this.qualifiedPath;
        // If we have a relative path, we will append it with a preceding
        // slash.
        if (relpath) {
            url = url + "/" + relpath;
        }
        return this.service.get(
            url,
            params,
            callback
        );
    },

### links

##### splunkjs.Service.Entity.links

Retrieves the links information for this entity, which is the URI of the entity relative to the management port of a Splunk instance.

#### Syntax

links: function()

#### Return

Object.

The links information.

#### Source (lib/service.js:938)

    links: function() {
        return this._links;
    },

### post

##### splunkjs.Service.Endpoint.post

Performs a relative POST request on an endpoint's path, combined with the parameters and a relative path if specified.

#### Syntax

post: function(relpath, params, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
relpath | String | A relative path to append to the endpoint path.
params | Object | A dictionary of entity-specific parameters to add to the body.
callback | Function | A function to call when the request is complete: `(err, response)`.

#### Examples

     // Will make a request to {service.prefix}/search/jobs/123456/control
     var endpoint = new splunkjs.Service.Endpoint(service, "search/jobs/12345");
     endpoint.post("control", {action: "cancel"}, function() { console.log("CANCELLED"))});

#### Source (lib/service.js:663)

    post: function(relpath, params, callback) {
        var url = this.qualifiedPath;
        // If we have a relative path, we will append it with a preceding
        // slash.
        if (relpath) {
            url = url + "/" + relpath;
        }
        return this.service.post(
            url,
            params,
            callback
        );
    },

### properties

##### splunkjs.Service.Resource.properties

Retrieves the current properties for this resource.

#### Syntax

properties: function()

#### Return

Object.

The properties.

#### Source (lib/service.js:797)

    properties: function() {
        return this._properties;
    },

### published

##### splunkjs.Service.Entity.published

Retrieves the published time for this entity.

#### Syntax

published: function()

#### Return

String.

The published time.

#### Source (lib/service.js:971)

    published: function() {
        return this._published;
    },

### reload

##### splunkjs.Service.Entity.reload

Reloads the entity on the server.

#### Syntax

reload: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call when the object is reloaded: `(err, entity)`.

#### Source (lib/service.js:1120)

    reload: function(callback) {
            callback = callback || function() {};

            var that = this;
            this.post("_reload", {}, function(err, response) {
                if (err) {
                    callback(err);
                }
                else {
                    callback(null, that);
                }
            });
        }
    });

### remove

##### splunkjs.Service.Entity.remove

Deletes the entity from the server.

#### Syntax

remove: function(callback)

#### Parameters

Name | Type | Description
--- | --- | ---
callback | Function | A function to call when the object is deleted: `(err)`.

#### Source (lib/service.js:1019)

    remove: function(callback) {
        callback = callback || function() {};

        var that = this;
        return this.del("", {}, function(err) {
            callback(err);
        });
    },

### state

##### splunkjs.Service.Resource.state

Retrieves the current full state (properties and metadata) of this resource.

#### Syntax

state: function()

#### Return

Object.

The current full state of this resource.

#### Source (lib/service.js:808)

    state: function() {
            return this._state;
        }
    });

### update

##### splunkjs.Service.Entity.update

Updates the entity on the server.

#### Syntax

update: function(props, callback)

#### Parameters

Name | Type | Description
--- | --- | ---
props | Object | The properties to update the object with.
callback | Function | A function to call when the object is updated: `(err, entity)`.

#### Source (lib/service.js:1037)

    update: function(props, callback) {
        callback = callback || function() {};

        if (props.hasOwnProperty("name")) {
            throw new Error("Cannot set 'name' field in 'update'");
        }

        var that = this;
        var req = this.post("", props, function(err, response) {
            if (!err && !that.fetchOnUpdate) {
                that._load(response.data.entry);
                callback(err, that);
            }
            else if (!err && that.fetchOnUpdate) {
                that.fetch(function() {
                    if (req.wasAborted) {
                        return; // aborted, so ignore
                    }
                    else {
                        callback.apply(null, arguments);
                    }
                });
            }
            else {
                callback(err, that);
            }
        });

        return req;
    },

### updated

##### splunkjs.Service.Entity.updated

Retrieves the updated time for this entity.

#### Syntax

updated: function()

#### Return

String.

The updated time.

#### Source (lib/service.js:960)

    updated: function() {
        return this._updated;
    },