repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | Toolbar | function Toolbar() {
var buttons = {};
/*jslint unparam: true*//* allow the unused param title until Toolbar rewrite*/
function add(id, text, title, fn) {
if (!buttons[id]) {
var button = renderer.text(
text,
0,
0
)
.css(options.toolbar.itemStyle)
.align({
alig... | javascript | function Toolbar() {
var buttons = {};
/*jslint unparam: true*//* allow the unused param title until Toolbar rewrite*/
function add(id, text, title, fn) {
if (!buttons[id]) {
var button = renderer.text(
text,
0,
0
)
.css(options.toolbar.itemStyle)
.align({
alig... | [
"function",
"Toolbar",
"(",
")",
"{",
"var",
"buttons",
"=",
"{",
"}",
";",
"/*jslint unparam: true*/",
"/* allow the unused param title until Toolbar rewrite*/",
"function",
"add",
"(",
"id",
",",
"text",
",",
"title",
",",
"fn",
")",
"{",
"if",
"(",
"!",
"bu... | end Axis
The toolbar object | [
"end",
"Axis",
"The",
"toolbar",
"object"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L18055-L18097 | train |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | defaultFormatter | function defaultFormatter() {
var pThis = this,
items = pThis.points || splat(pThis),
xAxis = items[0].series.xAxis,
x = pThis.x,
isDateTime = xAxis && xAxis.options.type === 'datetime',
useHeader = isString(x) || isDateTime,
s;
// build the header
s = useHeader ?
['<spa... | javascript | function defaultFormatter() {
var pThis = this,
items = pThis.points || splat(pThis),
xAxis = items[0].series.xAxis,
x = pThis.x,
isDateTime = xAxis && xAxis.options.type === 'datetime',
useHeader = isString(x) || isDateTime,
s;
// build the header
s = useHeader ?
['<spa... | [
"function",
"defaultFormatter",
"(",
")",
"{",
"var",
"pThis",
"=",
"this",
",",
"items",
"=",
"pThis",
".",
"points",
"||",
"splat",
"(",
"pThis",
")",
",",
"xAxis",
"=",
"items",
"[",
"0",
"]",
".",
"series",
".",
"xAxis",
",",
"x",
"=",
"pThis",... | In case no user defined formatter is given, this will be used | [
"In",
"case",
"no",
"user",
"defined",
"formatter",
"is",
"given",
"this",
"will",
"be",
"used"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L18163-L18183 | train |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | onmousemove | function onmousemove(e) {
var point,
points,
hoverPoint = chart.hoverPoint,
hoverSeries = chart.hoverSeries,
i,
j,
distance = chartWidth,
index = inverted ? e.chartY : e.chartX - plotLeft; // wtf?
// shared tooltip
if (tooltip && options.shared) {
points = [];
... | javascript | function onmousemove(e) {
var point,
points,
hoverPoint = chart.hoverPoint,
hoverSeries = chart.hoverSeries,
i,
j,
distance = chartWidth,
index = inverted ? e.chartY : e.chartX - plotLeft; // wtf?
// shared tooltip
if (tooltip && options.shared) {
points = [];
... | [
"function",
"onmousemove",
"(",
"e",
")",
"{",
"var",
"point",
",",
"points",
",",
"hoverPoint",
"=",
"chart",
".",
"hoverPoint",
",",
"hoverSeries",
"=",
"chart",
".",
"hoverSeries",
",",
"i",
",",
"j",
",",
"distance",
"=",
"chartWidth",
",",
"index",
... | With line type charts with a single tracker, get the point closest to the mouse | [
"With",
"line",
"type",
"charts",
"with",
"a",
"single",
"tracker",
"get",
"the",
"point",
"closest",
"to",
"the",
"mouse"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L18530-L18582 | train |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | drop | function drop() {
if (selectionMarker) {
var selectionData = {
xAxis: [],
yAxis: []
},
selectionBox = selectionMarker.getBBox(),
selectionLeft = selectionBox.x - plotLeft,
selectionTop = selectionBox.y - plotTop;
// a selection has been made
if (hasDragged) {... | javascript | function drop() {
if (selectionMarker) {
var selectionData = {
xAxis: [],
yAxis: []
},
selectionBox = selectionMarker.getBBox(),
selectionLeft = selectionBox.x - plotLeft,
selectionTop = selectionBox.y - plotTop;
// a selection has been made
if (hasDragged) {... | [
"function",
"drop",
"(",
")",
"{",
"if",
"(",
"selectionMarker",
")",
"{",
"var",
"selectionData",
"=",
"{",
"xAxis",
":",
"[",
"]",
",",
"yAxis",
":",
"[",
"]",
"}",
",",
"selectionBox",
"=",
"selectionMarker",
".",
"getBBox",
"(",
")",
",",
"select... | Mouse up or outside the plot area | [
"Mouse",
"up",
"or",
"outside",
"the",
"plot",
"area"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L18611-L18665 | train |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | hideTooltipOnMouseMove | function hideTooltipOnMouseMove(e) {
var pageX = defined(e.pageX) ? e.pageX : e.page.x, // In mootools the event is wrapped and the page x/y position is named e.page.x
pageY = defined(e.pageX) ? e.pageY : e.page.y; // Ref: http://mootools.net/docs/core/Types/DOMEvent
if (chartPosition &&
!isInsideP... | javascript | function hideTooltipOnMouseMove(e) {
var pageX = defined(e.pageX) ? e.pageX : e.page.x, // In mootools the event is wrapped and the page x/y position is named e.page.x
pageY = defined(e.pageX) ? e.pageY : e.page.y; // Ref: http://mootools.net/docs/core/Types/DOMEvent
if (chartPosition &&
!isInsideP... | [
"function",
"hideTooltipOnMouseMove",
"(",
"e",
")",
"{",
"var",
"pageX",
"=",
"defined",
"(",
"e",
".",
"pageX",
")",
"?",
"e",
".",
"pageX",
":",
"e",
".",
"page",
".",
"x",
",",
"// In mootools the event is wrapped and the page x/y position is named e.page.x\r"... | Special handler for mouse move that will hide the tooltip when the mouse leaves the plotarea. | [
"Special",
"handler",
"for",
"mouse",
"move",
"that",
"will",
"hide",
"the",
"tooltip",
"when",
"the",
"mouse",
"leaves",
"the",
"plotarea",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L18670-L18679 | train |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | destroy | function destroy() {
// Destroy the tracker group element
if (chart.trackerGroup) {
chart.trackerGroup = trackerGroup = chart.trackerGroup.destroy();
}
removeEvent(doc, 'mousemove', hideTooltipOnMouseMove);
container.onclick = container.onmousedown = container.onmousemove = container.ontouchs... | javascript | function destroy() {
// Destroy the tracker group element
if (chart.trackerGroup) {
chart.trackerGroup = trackerGroup = chart.trackerGroup.destroy();
}
removeEvent(doc, 'mousemove', hideTooltipOnMouseMove);
container.onclick = container.onmousedown = container.onmousemove = container.ontouchs... | [
"function",
"destroy",
"(",
")",
"{",
"// Destroy the tracker group element\r",
"if",
"(",
"chart",
".",
"trackerGroup",
")",
"{",
"chart",
".",
"trackerGroup",
"=",
"trackerGroup",
"=",
"chart",
".",
"trackerGroup",
".",
"destroy",
"(",
")",
";",
"}",
"remove... | Destroys the MouseTracker object and disconnects DOM events. | [
"Destroys",
"the",
"MouseTracker",
"object",
"and",
"disconnects",
"DOM",
"events",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L18911-L18919 | train |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | destroyItem | function destroyItem(item) {
var checkbox = item.checkbox;
// pull out from the array
//erase(allItems, item);
// destroy SVG elements
each(['legendItem', 'legendLine', 'legendSymbol'], function (key) {
if (item[key]) {
item[key].destroy();
}
});
if (checkbox) {
di... | javascript | function destroyItem(item) {
var checkbox = item.checkbox;
// pull out from the array
//erase(allItems, item);
// destroy SVG elements
each(['legendItem', 'legendLine', 'legendSymbol'], function (key) {
if (item[key]) {
item[key].destroy();
}
});
if (checkbox) {
di... | [
"function",
"destroyItem",
"(",
"item",
")",
"{",
"var",
"checkbox",
"=",
"item",
".",
"checkbox",
";",
"// pull out from the array\r",
"//erase(allItems, item);\r",
"// destroy SVG elements\r",
"each",
"(",
"[",
"'legendItem'",
",",
"'legendLine'",
",",
"'legendSymbol'... | Destroy a single legend item
@param {Object} item The series or point | [
"Destroy",
"a",
"single",
"legend",
"item"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L19079-L19097 | train |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function () {
if (!this.hasImportedEvents) {
var point = this,
options = merge(point.series.options.point, point.options),
events = options.events,
eventType;
point.events = events;
for (eventType in events) {
addEvent(point, eventType, events[eventType]);
}
this.hasImport... | javascript | function () {
if (!this.hasImportedEvents) {
var point = this,
options = merge(point.series.options.point, point.options),
events = options.events,
eventType;
point.events = events;
for (eventType in events) {
addEvent(point, eventType, events[eventType]);
}
this.hasImport... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"hasImportedEvents",
")",
"{",
"var",
"point",
"=",
"this",
",",
"options",
"=",
"merge",
"(",
"point",
".",
"series",
".",
"options",
".",
"point",
",",
"point",
".",
"options",
")",
",",
"ev... | Import events from the series' and point's options. Only do it on
demand, to save processing time on hovering. | [
"Import",
"events",
"from",
"the",
"series",
"and",
"point",
"s",
"options",
".",
"Only",
"do",
"it",
"on",
"demand",
"to",
"save",
"processing",
"time",
"on",
"hovering",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L20996-L21011 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function () {
var series = this,
options = series.options,
xIncrement = series.xIncrement;
xIncrement = pick(xIncrement, options.pointStart, 0);
series.pointInterval = pick(series.pointInterval, options.pointInterval, 1);
series.xIncrement = xIncrement + series.pointInterval;
return xIncrem... | javascript | function () {
var series = this,
options = series.options,
xIncrement = series.xIncrement;
xIncrement = pick(xIncrement, options.pointStart, 0);
series.pointInterval = pick(series.pointInterval, options.pointInterval, 1);
series.xIncrement = xIncrement + series.pointInterval;
return xIncrem... | [
"function",
"(",
")",
"{",
"var",
"series",
"=",
"this",
",",
"options",
"=",
"series",
".",
"options",
",",
"xIncrement",
"=",
"series",
".",
"xIncrement",
";",
"xIncrement",
"=",
"pick",
"(",
"xIncrement",
",",
"options",
".",
"pointStart",
",",
"0",
... | Return an auto incremented x value based on the pointStart and pointInterval options.
This is only used if an x value is not given for the point that calls autoIncrement. | [
"Return",
"an",
"auto",
"incremented",
"x",
"value",
"based",
"on",
"the",
"pointStart",
"and",
"pointInterval",
"options",
".",
"This",
"is",
"only",
"used",
"if",
"an",
"x",
"value",
"is",
"not",
"given",
"for",
"the",
"point",
"that",
"calls",
"autoIncr... | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L21143-L21154 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function () {
var series = this,
chart = series.chart,
data = series.data,
closestPoints,
smallestInterval,
chartSmallestInterval = chart.smallestInterval,
interval,
i;
// sort the data points
stableSort(data, function (a, b) {
return (a.x - b.x);
});
// remove points ... | javascript | function () {
var series = this,
chart = series.chart,
data = series.data,
closestPoints,
smallestInterval,
chartSmallestInterval = chart.smallestInterval,
interval,
i;
// sort the data points
stableSort(data, function (a, b) {
return (a.x - b.x);
});
// remove points ... | [
"function",
"(",
")",
"{",
"var",
"series",
"=",
"this",
",",
"chart",
"=",
"series",
".",
"chart",
",",
"data",
"=",
"series",
".",
"data",
",",
"closestPoints",
",",
"smallestInterval",
",",
"chartSmallestInterval",
"=",
"chart",
".",
"smallestInterval",
... | Sort the data and remove duplicates | [
"Sort",
"the",
"data",
"and",
"remove",
"duplicates"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L21159-L21209 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function () {
// trigger the event only if listeners exist
var series = this,
options = series.options,
chart = series.chart,
tooltip = chart.tooltip,
hoverPoint = chart.hoverPoint;
// trigger mouse out on the point, which must be in this series
if (hoverPoint) {
hoverPoint.onMouseOut(... | javascript | function () {
// trigger the event only if listeners exist
var series = this,
options = series.options,
chart = series.chart,
tooltip = chart.tooltip,
hoverPoint = chart.hoverPoint;
// trigger mouse out on the point, which must be in this series
if (hoverPoint) {
hoverPoint.onMouseOut(... | [
"function",
"(",
")",
"{",
"// trigger the event only if listeners exist\r",
"var",
"series",
"=",
"this",
",",
"options",
"=",
"series",
".",
"options",
",",
"chart",
"=",
"series",
".",
"chart",
",",
"tooltip",
"=",
"chart",
".",
"tooltip",
",",
"hoverPoint"... | Series mouse out handler | [
"Series",
"mouse",
"out",
"handler"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L21537-L21564 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function (options, base1, base2, base3) {
var conversion = this.pointAttrToOptions,
attr,
option,
obj = {};
options = options || {};
base1 = base1 || {};
base2 = base2 || {};
base3 = base3 || {};
for (attr in conversion) {
option = conversion[attr];
obj[attr] = pick(options[opt... | javascript | function (options, base1, base2, base3) {
var conversion = this.pointAttrToOptions,
attr,
option,
obj = {};
options = options || {};
base1 = base1 || {};
base2 = base2 || {};
base3 = base3 || {};
for (attr in conversion) {
option = conversion[attr];
obj[attr] = pick(options[opt... | [
"function",
"(",
"options",
",",
"base1",
",",
"base2",
",",
"base3",
")",
"{",
"var",
"conversion",
"=",
"this",
".",
"pointAttrToOptions",
",",
"attr",
",",
"option",
",",
"obj",
"=",
"{",
"}",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
... | Convert state properties from API naming conventions to SVG attributes
@param {Object} options API options object
@param {Object} base1 SVG attribute object to inherit from
@param {Object} base2 Second level SVG attribute object to inherit from | [
"Convert",
"state",
"properties",
"from",
"API",
"naming",
"conventions",
"to",
"SVG",
"attributes"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L21659-L21675 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function (state) {
var series = this,
options = series.options,
graph = series.graph,
stateOptions = options.states,
lineWidth = options.lineWidth;
state = state || NORMAL_STATE;
if (series.state !== state) {
series.state = state;
if (stateOptions[state] && stateOptions[state].ena... | javascript | function (state) {
var series = this,
options = series.options,
graph = series.graph,
stateOptions = options.states,
lineWidth = options.lineWidth;
state = state || NORMAL_STATE;
if (series.state !== state) {
series.state = state;
if (stateOptions[state] && stateOptions[state].ena... | [
"function",
"(",
"state",
")",
"{",
"var",
"series",
"=",
"this",
",",
"options",
"=",
"series",
".",
"options",
",",
"graph",
"=",
"series",
".",
"graph",
",",
"stateOptions",
"=",
"options",
".",
"states",
",",
"lineWidth",
"=",
"options",
".",
"line... | Set the state of the graph | [
"Set",
"the",
"state",
"of",
"the",
"graph"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L22281-L22307 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function (selected) {
var series = this;
// if called without an argument, toggle
series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected;
if (series.checkbox) {
series.checkbox.checked = selected;
}
fireEvent(series, selected ? 'select' : 'unselect');
} | javascript | function (selected) {
var series = this;
// if called without an argument, toggle
series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected;
if (series.checkbox) {
series.checkbox.checked = selected;
}
fireEvent(series, selected ? 'select' : 'unselect');
} | [
"function",
"(",
"selected",
")",
"{",
"var",
"series",
"=",
"this",
";",
"// if called without an argument, toggle\r",
"series",
".",
"selected",
"=",
"selected",
"=",
"(",
"selected",
"===",
"UNDEFINED",
")",
"?",
"!",
"series",
".",
"selected",
":",
"select... | Set the selected state of the graph
@param selected {Boolean} True to select the series, false to unselect. If
UNDEFINED, the selection state is toggled. | [
"Set",
"the",
"selected",
"state",
"of",
"the",
"graph"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L22403-L22413 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function () {
var series = this,
chart = series.chart,
renderer = chart.renderer,
shapeArgs,
tracker,
trackerLabel = +new Date(),
options = series.options,
cursor = options.cursor,
css = cursor && { cursor: cursor },
rel;
each(series.data, function (point) {
tracker = poi... | javascript | function () {
var series = this,
chart = series.chart,
renderer = chart.renderer,
shapeArgs,
tracker,
trackerLabel = +new Date(),
options = series.options,
cursor = options.cursor,
css = cursor && { cursor: cursor },
rel;
each(series.data, function (point) {
tracker = poi... | [
"function",
"(",
")",
"{",
"var",
"series",
"=",
"this",
",",
"chart",
"=",
"series",
".",
"chart",
",",
"renderer",
"=",
"chart",
".",
"renderer",
",",
"shapeArgs",
",",
"tracker",
",",
"trackerLabel",
"=",
"+",
"new",
"Date",
"(",
")",
",",
"option... | Draw the individual tracker elements.
This method is inherited by scatter and pie charts too. | [
"Draw",
"the",
"individual",
"tracker",
"elements",
".",
"This",
"method",
"is",
"inherited",
"by",
"scatter",
"and",
"pie",
"charts",
"too",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L22800-L22850 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function () {
var series = this;
Series.prototype.translate.apply(series);
each(series.data, function (point) {
point.shapeType = 'circle';
point.shapeArgs = {
x: point.plotX,
y: point.plotY,
r: series.chart.options.tooltip.snap
};
});
} | javascript | function () {
var series = this;
Series.prototype.translate.apply(series);
each(series.data, function (point) {
point.shapeType = 'circle';
point.shapeArgs = {
x: point.plotX,
y: point.plotY,
r: series.chart.options.tooltip.snap
};
});
} | [
"function",
"(",
")",
"{",
"var",
"series",
"=",
"this",
";",
"Series",
".",
"prototype",
".",
"translate",
".",
"apply",
"(",
"series",
")",
";",
"each",
"(",
"series",
".",
"data",
",",
"function",
"(",
"point",
")",
"{",
"point",
".",
"shapeType",... | Extend the base Series' translate method by adding shape type and
arguments for the point trackers | [
"Extend",
"the",
"base",
"Series",
"translate",
"method",
"by",
"adding",
"shape",
"type",
"and",
"arguments",
"for",
"the",
"point",
"trackers"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L22936-L22949 | train | |
splunk/splunk-sdk-javascript | client/splunk.ui.charting.js | function () {
var series = this;
// cache attributes for shapes
//series.getAttribs();
this.drawPoints();
// draw the mouse tracking area
if (series.options.enableMouseTracking !== false) {
series.drawTracker();
}
// PATCH by Simon Fishel
//
// execute... | javascript | function () {
var series = this;
// cache attributes for shapes
//series.getAttribs();
this.drawPoints();
// draw the mouse tracking area
if (series.options.enableMouseTracking !== false) {
series.drawTracker();
}
// PATCH by Simon Fishel
//
// execute... | [
"function",
"(",
")",
"{",
"var",
"series",
"=",
"this",
";",
"// cache attributes for shapes\r",
"//series.getAttribs();\r",
"this",
".",
"drawPoints",
"(",
")",
";",
"// draw the mouse tracking area\r",
"if",
"(",
"series",
".",
"options",
".",
"enableMouseTracking"... | Render the slices | [
"Render",
"the",
"slices"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.ui.charting.js#L23274-L23306 | train | |
splunk/splunk-sdk-javascript | lib/modularinputs/argument.js | Argument | function Argument(argumentConfig) {
if (!argumentConfig) {
argumentConfig = {};
}
this.name = utils.isUndefined(argumentConfig.name) ? "" : argumentConfig.name;
this.description = utils.isUndefined(argumentConfig.description) ? null : argumentConfig.description;
this... | javascript | function Argument(argumentConfig) {
if (!argumentConfig) {
argumentConfig = {};
}
this.name = utils.isUndefined(argumentConfig.name) ? "" : argumentConfig.name;
this.description = utils.isUndefined(argumentConfig.description) ? null : argumentConfig.description;
this... | [
"function",
"Argument",
"(",
"argumentConfig",
")",
"{",
"if",
"(",
"!",
"argumentConfig",
")",
"{",
"argumentConfig",
"=",
"{",
"}",
";",
"}",
"this",
".",
"name",
"=",
"utils",
".",
"isUndefined",
"(",
"argumentConfig",
".",
"name",
")",
"?",
"\"\"",
... | Class representing an argument to a modular input kind.
`Argument` is meant to be used with `Scheme` to generate an XML
definition of the modular input kind that Splunk understands.
`name` is the only required parameter for the constructor.
@example
// Example with minimal parameters
var myArg1 = new Argument({name... | [
"Class",
"representing",
"an",
"argument",
"to",
"a",
"modular",
"input",
"kind",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/modularinputs/argument.js#L46-L57 | train |
splunk/splunk-sdk-javascript | lib/modularinputs/event.js | Event | function Event(eventConfig) {
eventConfig = utils.isUndefined(eventConfig) ? {} : eventConfig;
this.data = utils.isUndefined(eventConfig.data) ? null : eventConfig.data;
this.done = utils.isUndefined(eventConfig.done) ? true : eventConfig.done;
this.host = utils.isUndefined(eventConfig.... | javascript | function Event(eventConfig) {
eventConfig = utils.isUndefined(eventConfig) ? {} : eventConfig;
this.data = utils.isUndefined(eventConfig.data) ? null : eventConfig.data;
this.done = utils.isUndefined(eventConfig.done) ? true : eventConfig.done;
this.host = utils.isUndefined(eventConfig.... | [
"function",
"Event",
"(",
"eventConfig",
")",
"{",
"eventConfig",
"=",
"utils",
".",
"isUndefined",
"(",
"eventConfig",
")",
"?",
"{",
"}",
":",
"eventConfig",
";",
"this",
".",
"data",
"=",
"utils",
".",
"isUndefined",
"(",
"eventConfig",
".",
"data",
"... | `Event` represents an event or fragment of an event to be written by this
modular input to Splunk.
@example
// Minimal configuration
var myEvent = new Event({
data: "This is a test of my new event.",
stanza: "myStanzaName",
time: parseFloat("1372187084.000")
});
// Full configuration
var myBetterEvent = new Event(... | [
"Event",
"represents",
"an",
"event",
"or",
"fragment",
"of",
"an",
"event",
"to",
"be",
"written",
"by",
"this",
"modular",
"input",
"to",
"Splunk",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/lib/modularinputs/event.js#L49-L63 | train |
splunk/splunk-sdk-javascript | examples/node/helloworld/search_normal.js | function(results, job, done) {
// Print out the statics
console.log("Job Statistics: ");
console.log(" Event Count: " + job.properties().eventCount);
console.log(" Disk Usage: " + job.properties().diskUsage + " bytes");
console.log(" Pri... | javascript | function(results, job, done) {
// Print out the statics
console.log("Job Statistics: ");
console.log(" Event Count: " + job.properties().eventCount);
console.log(" Disk Usage: " + job.properties().diskUsage + " bytes");
console.log(" Pri... | [
"function",
"(",
"results",
",",
"job",
",",
"done",
")",
"{",
"// Print out the statics",
"console",
".",
"log",
"(",
"\"Job Statistics: \"",
")",
";",
"console",
".",
"log",
"(",
"\" Event Count: \"",
"+",
"job",
".",
"properties",
"(",
")",
".",
"eventCo... | Print out the statistics and get the results | [
"Print",
"out",
"the",
"statistics",
"and",
"get",
"the",
"results"
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/examples/node/helloworld/search_normal.js#L63-L86 | train | |
splunk/splunk-sdk-javascript | contrib/nodeunit/junit_reporter.js | function (path, callback) {
var mkdir = child_process.spawn('mkdir', ['-p', path]);
mkdir.on('error', function (err) {
callback(err);
callback = function(){};
});
mkdir.on('exit', function (code) {
if (code === 0) callback();
else callback(new Error('mkdir exited with cod... | javascript | function (path, callback) {
var mkdir = child_process.spawn('mkdir', ['-p', path]);
mkdir.on('error', function (err) {
callback(err);
callback = function(){};
});
mkdir.on('exit', function (code) {
if (code === 0) callback();
else callback(new Error('mkdir exited with cod... | [
"function",
"(",
"path",
",",
"callback",
")",
"{",
"var",
"mkdir",
"=",
"child_process",
".",
"spawn",
"(",
"'mkdir'",
",",
"[",
"'-p'",
",",
"path",
"]",
")",
";",
"mkdir",
".",
"on",
"(",
"'error'",
",",
"function",
"(",
"err",
")",
"{",
"callba... | Ensures a directory exists using mkdir -p.
@param {String} path
@param {Function} callback
@api private | [
"Ensures",
"a",
"directory",
"exists",
"using",
"mkdir",
"-",
"p",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/contrib/nodeunit/junit_reporter.js#L41-L51 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(http, params) {
if (!(http instanceof Http) && !params) {
// Move over the params
params = http;
http = null;
}
params = params || {};
this.scheme = params.scheme || "https";
this.host ... | javascript | function(http, params) {
if (!(http instanceof Http) && !params) {
// Move over the params
params = http;
http = null;
}
params = params || {};
this.scheme = params.scheme || "https";
this.host ... | [
"function",
"(",
"http",
",",
"params",
")",
"{",
"if",
"(",
"!",
"(",
"http",
"instanceof",
"Http",
")",
"&&",
"!",
"params",
")",
"{",
"// Move over the params",
"params",
"=",
"http",
";",
"http",
"=",
"null",
";",
"}",
"params",
"=",
"params",
"|... | Constructor for `splunkjs.Context`.
@constructor
@param {splunkjs.Http} http An instance of a `splunkjs.Http` class.
@param {Object} params A dictionary of optional parameters:
- `scheme` (_string_): The scheme ("http" or "https") for accessing Splunk.
- `host` (_string_): The host name (the default is "localhost").
-... | [
"Constructor",
"for",
"splunkjs",
".",
"Context",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L1134-L1199 | train | |
splunk/splunk-sdk-javascript | 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.shari... | javascript | 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.shari... | [
"function",
"(",
"path",
",",
"namespace",
")",
"{",
"namespace",
"=",
"namespace",
"||",
"{",
"}",
";",
"if",
"(",
"utils",
".",
"startsWith",
"(",
"path",
",",
"\"/\"",
")",
")",
"{",
"return",
"path",
";",
"}",
"// If we don't have an app name (explicit... | 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",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L1317-L1346 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(callback) {
var that = this;
var url = this.paths.login;
var params = {
username: this.username,
password: this.password,
cookie : '1'
};
callback = callback || function() {};
var wrappedCa... | javascript | function(callback) {
var that = this;
var url = this.paths.login;
var params = {
username: this.username,
password: this.password,
cookie : '1'
};
callback = callback || function() {};
var wrappedCa... | [
"function",
"(",
"callback",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"url",
"=",
"this",
".",
"paths",
".",
"login",
";",
"var",
"params",
"=",
"{",
"username",
":",
"this",
".",
"username",
",",
"password",
":",
"this",
".",
"password",
... | Authenticates and logs in to a Splunk instance, then stores the
resulting session key.
@param {Function} callback The function to call when login has finished: `(err, wasSuccessful)`.
@method splunkjs.Context
@private | [
"Authenticates",
"and",
"logs",
"in",
"to",
"a",
"Splunk",
"instance",
"then",
"stores",
"the",
"resulting",
"session",
"key",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L1370-L1401 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(path, params, callback) {
var that = this;
var request = function(callback) {
return that.http.del(
that.urlify(path),
that._headers(),
params,
that.timeout,
callback
... | javascript | function(path, params, callback) {
var that = this;
var request = function(callback) {
return that.http.del(
that.urlify(path),
that._headers(),
params,
that.timeout,
callback
... | [
"function",
"(",
"path",
",",
"params",
",",
"callback",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"request",
"=",
"function",
"(",
"callback",
")",
"{",
"return",
"that",
".",
"http",
".",
"del",
"(",
"that",
".",
"urlify",
"(",
"path",
")... | Performs a DELETE request.
@param {String} path The REST endpoint path of the DELETE request.
@param {Object} params The entity-specific parameters for this request.
@param {Function} callback The function to call when the request is complete: `(err, response)`.
@method splunkjs.Context | [
"Performs",
"a",
"DELETE",
"request",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L1454-L1467 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(path, method, query, post, body, headers, callback) {
var that = this;
var request = function(callback) {
return that.http.request(
that.urlify(path),
{
method: method,
headers: that.... | javascript | function(path, method, query, post, body, headers, callback) {
var that = this;
var request = function(callback) {
return that.http.request(
that.urlify(path),
{
method: method,
headers: that.... | [
"function",
"(",
"path",
",",
"method",
",",
"query",
",",
"post",
",",
"body",
",",
"headers",
",",
"callback",
")",
"{",
"var",
"that",
"=",
"this",
";",
"var",
"request",
"=",
"function",
"(",
"callback",
")",
"{",
"return",
"that",
".",
"http",
... | Issues an arbitrary HTTP request to the REST endpoint path segment.
@param {String} path The REST endpoint path segment (with any query parameters already appended and encoded).
@param {String} method The HTTP method (can be `GET`, `POST`, or `DELETE`).
@param {Object} query The entity-specific parameters for this req... | [
"Issues",
"an",
"arbitrary",
"HTTP",
"request",
"to",
"the",
"REST",
"endpoint",
"path",
"segment",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L1506-L1524 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function() {
this._super.apply(this, arguments);
// We perform the bindings so that every function works
// properly when it is passed as a callback.
this.specialize = utils.bind(this, this.specialize);
this.apps = utils.bind(this, this... | javascript | function() {
this._super.apply(this, arguments);
// We perform the bindings so that every function works
// properly when it is passed as a callback.
this.specialize = utils.bind(this, this.specialize);
this.apps = utils.bind(this, this... | [
"function",
"(",
")",
"{",
"this",
".",
"_super",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"// We perform the bindings so that every function works ",
"// properly when it is passed as a callback.",
"this",
".",
"specialize",
"=",
"utils",
".",
"bind",
"... | Constructor for `splunkjs.Service`.
@constructor
@param {splunkjs.Http} http An instance of a `splunkjs.Http` class.
@param {Object} params A dictionary of optional parameters:
- `scheme` (_string_): The scheme ("http" or "https") for accessing Splunk.
- `host` (_string_): The host name (the default is "localhost").
-... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2303-L2319 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(owner, app) {
return new Service(this.http, {
scheme: this.scheme,
host: this.host,
port: this.port,
username: this.username,
password: this.password,
owner: owner,
app: app,
... | javascript | function(owner, app) {
return new Service(this.http, {
scheme: this.scheme,
host: this.host,
port: this.port,
username: this.username,
password: this.password,
owner: owner,
app: app,
... | [
"function",
"(",
"owner",
",",
"app",
")",
"{",
"return",
"new",
"Service",
"(",
"this",
".",
"http",
",",
"{",
"scheme",
":",
"this",
".",
"scheme",
",",
"host",
":",
"this",
".",
"host",
",",
"port",
":",
"this",
".",
"port",
",",
"username",
"... | Creates a specialized version of the current `Service` instance for
a specific namespace context.
@example
var svc = ...;
var newService = svc.specialize("myuser", "unix");
@param {String} owner The Splunk username, such as "admin". A value of "nobody" means no specific user. The "-" wildcard means all users.
@param... | [
"Creates",
"a",
"specialized",
"version",
"of",
"the",
"current",
"Service",
"instance",
"for",
"a",
"specific",
"namespace",
"context",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2336-L2348 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(sid, namespace, callback) {
if (!callback && utils.isFunction(namespace)) {
callback = namespace;
namespace = null;
}
var job = new root.Job(this, sid, namespace);
return job.fetch({}, callback);
} | javascript | function(sid, namespace, callback) {
if (!callback && utils.isFunction(namespace)) {
callback = namespace;
namespace = null;
}
var job = new root.Job(this, sid, namespace);
return job.fetch({}, callback);
} | [
"function",
"(",
"sid",
",",
"namespace",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"namespace",
")",
")",
"{",
"callback",
"=",
"namespace",
";",
"namespace",
"=",
"null",
";",
"}",
"var",
"job",
"... | A convenience method to get a `Job` by its sid.
@param {String} sid The search ID for a search job.
@param {Object} namespace 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 cont... | [
"A",
"convenience",
"method",
"to",
"get",
"a",
"Job",
"by",
"its",
"sid",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2650-L2657 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(callback) {
callback = callback || function() {};
var that = this;
var req = this.get(Paths.currentUser, {}, function(err, response) {
if (err) {
callback(err);
}
else {
var... | javascript | function(callback) {
callback = callback || function() {};
var that = this;
var req = this.get(Paths.currentUser, {}, function(err, response) {
if (err) {
callback(err);
}
else {
var... | [
"function",
"(",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"var",
"that",
"=",
"this",
";",
"var",
"req",
"=",
"this",
".",
"get",
"(",
"Paths",
".",
"currentUser",
",",
"{",
"}",
",",
"function",... | Gets the user that is currently logged in.
@example
service.currentUser(function(err, user) {
console.log("Real name: ", user.properties().realname);
});
@param {Function} callback A function to call with the user instance: `(err, user)`.
@return {splunkjs.Service.currentUser} The `User`.
@endpoint authorization/cu... | [
"Gets",
"the",
"user",
"that",
"is",
"currently",
"logged",
"in",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2708-L2731 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(query, params, callback) {
if (!callback && utils.isFunction(params)) {
callback = params;
params = {};
}
callback = callback || function() {};
params = params || {};
params.q = query;
... | javascript | function(query, params, callback) {
if (!callback && utils.isFunction(params)) {
callback = params;
params = {};
}
callback = callback || function() {};
params = params || {};
params.q = query;
... | [
"function",
"(",
"query",
",",
"params",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"params",
")",
")",
"{",
"callback",
"=",
"params",
";",
"params",
"=",
"{",
"}",
";",
"}",
"callback",
"=",
"cal... | Parses a search query.
@example
service.parse("search index=_internal | head 1", function(err, parse) {
console.log("Commands: ", parse.commands);
});
@param {String} query The search query to parse.
@param {Object} params An object of options for the parser:
- `enable_lookups` (_boolean_): If `true`, performs rever... | [
"Parses",
"a",
"search",
"query",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2774-L2793 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(prefix, count, callback) {
if (!callback && utils.isFunction(count)) {
callback = count;
count = 10;
}
callback = callback || function() {};
var params = {
count: count || 10,
prefix: pr... | javascript | function(prefix, count, callback) {
if (!callback && utils.isFunction(count)) {
callback = count;
count = 10;
}
callback = callback || function() {};
var params = {
count: count || 10,
prefix: pr... | [
"function",
"(",
"prefix",
",",
"count",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"count",
")",
")",
"{",
"callback",
"=",
"count",
";",
"count",
"=",
"10",
";",
"}",
"callback",
"=",
"callback",
... | Provides auto-complete suggestions for search queries.
@example
service.typeahead("index=", 10, function(err, options) {
console.log("Autocompletion options: ", options);
});
@param {String} prefix The query fragment to autocomplete.
@param {Number} count The number of options to return (optional).
@param {Function}... | [
"Provides",
"auto",
"-",
"complete",
"suggestions",
"for",
"search",
"queries",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2811-L2832 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(event, params, callback) {
if (!callback && utils.isFunction(params)) {
callback = params;
params = {};
}
callback = callback || function() {};
params = params || {};
// If the event is a JSON ... | javascript | function(event, params, callback) {
if (!callback && utils.isFunction(params)) {
callback = params;
params = {};
}
callback = callback || function() {};
params = params || {};
// If the event is a JSON ... | [
"function",
"(",
"event",
",",
"params",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"params",
")",
")",
"{",
"callback",
"=",
"params",
";",
"params",
"=",
"{",
"}",
";",
"}",
"callback",
"=",
"cal... | Logs an event to Splunk.
@example
service.log("A new event", {index: "_internal", sourcetype: "mysourcetype"}, function(err, result) {
console.log("Submitted event: ", result);
});
@param {String|Object} event The text for this event, or a JSON object.
@param {Object} params A dictionary of parameters for indexing:
... | [
"Logs",
"an",
"event",
"to",
"Splunk",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2855-L2894 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, qualifiedPath) {
if (!service) {
throw new Error("Passed in a null Service.");
}
if (!qualifiedPath) {
throw new Error("Passed in an empty path.");
}
this.service = service;
this.qualifiedPath = q... | javascript | function(service, qualifiedPath) {
if (!service) {
throw new Error("Passed in a null Service.");
}
if (!qualifiedPath) {
throw new Error("Passed in an empty path.");
}
this.service = service;
this.qualifiedPath = q... | [
"function",
"(",
"service",
",",
"qualifiedPath",
")",
"{",
"if",
"(",
"!",
"service",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Passed in a null Service.\"",
")",
";",
"}",
"if",
"(",
"!",
"qualifiedPath",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Pas... | Constructor for `splunkjs.Service.Endpoint`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} qualifiedPath A fully-qualified relative endpoint path (for example, "/services/search/jobs").
@return {splunkjs.Service.Endpoint} A new `splunkjs.Service.Endpoint` instance.
@method splun... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"Endpoint",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2916-L2933 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | 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(
... | javascript | 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(
... | [
"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",
"+",
... | Performs a relative GET request on an endpoint's path,
combined with the parameters and a relative path if specified.
@example
// 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},... | [
"Performs",
"a",
"relative",
"GET",
"request",
"on",
"an",
"endpoint",
"s",
"path",
"combined",
"with",
"the",
"parameters",
"and",
"a",
"relative",
"path",
"if",
"specified",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2951-L2965 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | 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(
... | javascript | 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(
... | [
"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",
"+",
... | Performs a relative POST request on an endpoint's path,
combined with the parameters and a relative path if specified.
@example
// 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"},... | [
"Performs",
"a",
"relative",
"POST",
"request",
"on",
"an",
"endpoint",
"s",
"path",
"combined",
"with",
"the",
"parameters",
"and",
"a",
"relative",
"path",
"if",
"specified",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L2983-L2997 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | 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(
... | javascript | 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(
... | [
"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",
"+",
... | Performs a relative DELETE request on an endpoint's path,
combined with the parameters and a relative path if specified.
@example
// 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("... | [
"Performs",
"a",
"relative",
"DELETE",
"request",
"on",
"an",
"endpoint",
"s",
"path",
"combined",
"with",
"the",
"parameters",
"and",
"a",
"relative",
"path",
"if",
"specified",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3015-L3029 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, path, namespace) {
var fullpath = service.fullpath(path, namespace);
this._super(service, fullpath);
this.namespace = namespace;
this._properties = {};
this._state = {};
// We perform the bindings so that... | javascript | function(service, path, namespace) {
var fullpath = service.fullpath(path, namespace);
this._super(service, fullpath);
this.namespace = namespace;
this._properties = {};
this._state = {};
// We perform the bindings so that... | [
"function",
"(",
"service",
",",
"path",
",",
"namespace",
")",
"{",
"var",
"fullpath",
"=",
"service",
".",
"fullpath",
"(",
"path",
",",
"namespace",
")",
";",
"this",
".",
"_super",
"(",
"service",
",",
"fullpath",
")",
";",
"this",
".",
"namespace"... | Constructor for `splunkjs.Service.Resource`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} path A relative endpoint path (for example, "search/jobs").
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" ... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"Resource",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3058-L3073 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, path, namespace) {
this._super(service, path, namespace);
// We perform the bindings so that every function works
// properly when it is passed as a callback.
this._load = utils.bind(this, this._load);
this.fetch = utils... | javascript | function(service, path, namespace) {
this._super(service, path, namespace);
// We perform the bindings so that every function works
// properly when it is passed as a callback.
this._load = utils.bind(this, this._load);
this.fetch = utils... | [
"function",
"(",
"service",
",",
"path",
",",
"namespace",
")",
"{",
"this",
".",
"_super",
"(",
"service",
",",
"path",
",",
"namespace",
")",
";",
"// We perform the bindings so that every function works ",
"// properly when it is passed as a callback.",
"this",
".",
... | Constructor for `splunkjs.Service.Entity`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} path A relative endpoint path (for example, "search/jobs").
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" me... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"Entity",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3168-L3192 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(properties) {
properties = utils.isArray(properties) ? properties[0] : properties;
// Initialize the properties to
// empty values
properties = properties || {
content: {},
fields: {},
acl: {},
... | javascript | function(properties) {
properties = utils.isArray(properties) ? properties[0] : properties;
// Initialize the properties to
// empty values
properties = properties || {
content: {},
fields: {},
acl: {},
... | [
"function",
"(",
"properties",
")",
"{",
"properties",
"=",
"utils",
".",
"isArray",
"(",
"properties",
")",
"?",
"properties",
"[",
"0",
"]",
":",
"properties",
";",
"// Initialize the properties to",
"// empty values",
"properties",
"=",
"properties",
"||",
"{... | Loads the entity and stores the properties.
@param {Object} properties The properties for this entity.
@method splunkjs.Service.Entity
@protected | [
"Loads",
"the",
"entity",
"and",
"stores",
"the",
"properties",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3202-L3224 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(options, callback) {
if (!callback && utils.isFunction(options)) {
callback = options;
options = {};
}
callback = callback || function() {};
options = options || {};
var that = this;
... | javascript | function(options, callback) {
if (!callback && utils.isFunction(options)) {
callback = options;
options = {};
}
callback = callback || function() {};
options = options || {};
var that = this;
... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"options",
")",
")",
"{",
"callback",
"=",
"options",
";",
"options",
"=",
"{",
"}",
";",
"}",
"callback",
"=",
"callback",
"||"... | Refreshes the entity by fetching the object from the server and
loading it.
@param {Object} options 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_):... | [
"Refreshes",
"the",
"entity",
"by",
"fetching",
"the",
"object",
"from",
"the",
"server",
"and",
"loading",
"it",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3310-L3329 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | 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(e... | javascript | 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(e... | [
"function",
"(",
"props",
",",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"if",
"(",
"props",
".",
"hasOwnProperty",
"(",
"\"name\"",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Cannot set 'name' fie... | Updates the entity on the server.
@param {Object} props The properties to update the object with.
@param {Function} callback A function to call when the object is updated: `(err, entity)`.
@method splunkjs.Service.Entity
@protected | [
"Updates",
"the",
"entity",
"on",
"the",
"server",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3357-L3386 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(callback) {
callback = callback || function() {};
var that = this;
this.post("disable", {}, function(err, response) {
if (err) {
callback(err);
}
else {
callback(null, that);... | javascript | function(callback) {
callback = callback || function() {};
var that = this;
this.post("disable", {}, function(err, response) {
if (err) {
callback(err);
}
else {
callback(null, that);... | [
"function",
"(",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"var",
"that",
"=",
"this",
";",
"this",
".",
"post",
"(",
"\"disable\"",
",",
"{",
"}",
",",
"function",
"(",
"err",
",",
"response",
")... | Disables the entity on the server.
@param {Function} callback A function to call when the object is disabled: `(err, entity)`.
@method splunkjs.Service.Entity
@protected | [
"Disables",
"the",
"entity",
"on",
"the",
"server",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3396-L3408 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, path, namespace) {
this._super(service, path, namespace);
// We perform the bindings so that every function works
// properly when it is passed as a callback.
this._load = utils.bind(this, this._load);
this.fetch ... | javascript | function(service, path, namespace) {
this._super(service, path, namespace);
// We perform the bindings so that every function works
// properly when it is passed as a callback.
this._load = utils.bind(this, this._load);
this.fetch ... | [
"function",
"(",
"service",
",",
"path",
",",
"namespace",
")",
"{",
"this",
".",
"_super",
"(",
"service",
",",
"path",
",",
"namespace",
")",
";",
"// We perform the bindings so that every function works ",
"// properly when it is passed as a callback.",
"this",
".",
... | Constructor for `splunkjs.Service.Collection`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} path A relative endpoint path (for example, "search/jobs").
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"Collection",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3487-L3505 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(options, callback) {
if (!callback && utils.isFunction(options)) {
callback = options;
options = {};
}
callback = callback || function() {};
options = options || {};
if (!options.count) {
op... | javascript | function(options, callback) {
if (!callback && utils.isFunction(options)) {
callback = options;
options = {};
}
callback = callback || function() {};
options = options || {};
if (!options.count) {
op... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"options",
")",
")",
"{",
"callback",
"=",
"options",
";",
"options",
"=",
"{",
"}",
";",
"}",
"callback",
"=",
"callback",
"||"... | Refreshes the resource by fetching the object from the server and
loading it.
@param {Object} options A 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 sea... | [
"Refreshes",
"the",
"resource",
"by",
"fetching",
"the",
"object",
"from",
"the",
"server",
"and",
"loading",
"it",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3603-L3627 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(id, namespace) {
if (utils.isEmpty(namespace)) {
namespace = null;
}
if (!id) {
throw new Error("Must suply a non-empty name.");
}
if (namespace && (namespace.app === '-' || names... | javascript | function(id, namespace) {
if (utils.isEmpty(namespace)) {
namespace = null;
}
if (!id) {
throw new Error("Must suply a non-empty name.");
}
if (namespace && (namespace.app === '-' || names... | [
"function",
"(",
"id",
",",
"namespace",
")",
"{",
"if",
"(",
"utils",
".",
"isEmpty",
"(",
"namespace",
")",
")",
"{",
"namespace",
"=",
"null",
";",
"}",
"if",
"(",
"!",
"id",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Must suply a non-empty name.\""... | Returns a specific entity from the collection.
@example
var apps = service.apps();
apps.fetch(function(err, apps) {
var app = apps.item("search");
console.log("Search App Found: " + !!app);
// `app` is an Application object.
});
@param {String} id The name of the entity to retrieve.
@param {Object} namespace Namespa... | [
"Returns",
"a",
"specific",
"entity",
"from",
"the",
"collection",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3650-L3707 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(params, callback) {
callback = callback || function() {};
var that = this;
var req = this.post("", params, function(err, response) {
if (err) {
callback(err);
}
else {
var props = respons... | javascript | function(params, callback) {
callback = callback || function() {};
var that = this;
var req = this.post("", params, function(err, response) {
if (err) {
callback(err);
}
else {
var props = respons... | [
"function",
"(",
"params",
",",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"var",
"that",
"=",
"this",
";",
"var",
"req",
"=",
"this",
".",
"post",
"(",
"\"\"",
",",
"params",
",",
"function",
"(",... | Creates an entity on the server for this collection with the specified
parameters.
@example
var apps = service.apps();
apps.create({name: "NewSearchApp"}, function(err, newApp) {
console.log("CREATED");
});
@param {Object} params A dictionary of entity-specific properties.
@param {Function} callback The function to ... | [
"Creates",
"an",
"entity",
"on",
"the",
"server",
"for",
"this",
"collection",
"with",
"the",
"specified",
"parameters",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3726-L3759 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, name, namespace) {
this.name = name;
this._super(service, this.path(), namespace);
this.acknowledge = utils.bind(this, this.acknowledge);
this.dispatch = utils.bind(this, this.dispatch);
this.history = utils.bind(this, ... | javascript | function(service, name, namespace) {
this.name = name;
this._super(service, this.path(), namespace);
this.acknowledge = utils.bind(this, this.acknowledge);
this.dispatch = utils.bind(this, this.dispatch);
this.history = utils.bind(this, ... | [
"function",
"(",
"service",
",",
"name",
",",
"namespace",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"_super",
"(",
"service",
",",
"this",
".",
"path",
"(",
")",
",",
"namespace",
")",
";",
"this",
".",
"acknowledge",
"=",
"uti... | Constructor for `splunkjs.Service.SavedSearch`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} name The name for the new saved search.
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" means no specific... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"SavedSearch",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3815-L3823 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(options, callback) {
if (!callback && utils.isFunction(options)) {
callback = options;
options = {};
}
callback = callback || function() {};
options = options || {};
var that = this;
... | javascript | function(options, callback) {
if (!callback && utils.isFunction(options)) {
callback = options;
options = {};
}
callback = callback || function() {};
options = options || {};
var that = this;
... | [
"function",
"(",
"options",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"options",
")",
")",
"{",
"callback",
"=",
"options",
";",
"options",
"=",
"{",
"}",
";",
"}",
"callback",
"=",
"callback",
"||"... | Dispatches a saved search, which creates a search job and returns a
`splunkjs.Service.Job` instance in the callback function.
@example
var savedSearch = service.savedSearches().item("MySavedSearch");
savedSearch.dispatch({force_dispatch: false}, function(err, job, savedSearch) {
console.log("Job SID: ", job.sid);
});... | [
"Dispatches",
"a",
"saved",
"search",
"which",
"creates",
"a",
"search",
"job",
"and",
"returns",
"a",
"splunkjs",
".",
"Service",
".",
"Job",
"instance",
"in",
"the",
"callback",
"function",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L3890-L3913 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(params, callback) {
params = params || {};
if (!params.search) {
var update = this._super;
var req = this.fetch(function(err, search) {
if (err) {
callback(err);
}
... | javascript | function(params, callback) {
params = params || {};
if (!params.search) {
var update = this._super;
var req = this.fetch(function(err, search) {
if (err) {
callback(err);
}
... | [
"function",
"(",
"params",
",",
"callback",
")",
"{",
"params",
"=",
"params",
"||",
"{",
"}",
";",
"if",
"(",
"!",
"params",
".",
"search",
")",
"{",
"var",
"update",
"=",
"this",
".",
"_super",
";",
"var",
"req",
"=",
"this",
".",
"fetch",
"(",... | Updates the saved search on the server.
**Note:** The search query is required, even when it isn't being modified.
If you don't provide it, this method will fetch the search string from
the server or from the local cache.
@param {Object} props The properties to update the saved search with. For a list of available pa... | [
"Updates",
"the",
"saved",
"search",
"on",
"the",
"server",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4010-L4037 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.SavedSearch(this.service, props.name, entityNamespace);
} | javascript | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.SavedSearch(this.service, props.name, entityNamespace);
} | [
"function",
"(",
"props",
")",
"{",
"var",
"entityNamespace",
"=",
"utils",
".",
"namespaceFromProperties",
"(",
"props",
")",
";",
"return",
"new",
"root",
".",
"SavedSearch",
"(",
"this",
".",
"service",
",",
"props",
".",
"name",
",",
"entityNamespace",
... | Creates a local instance of a saved search.
@param {Object} props The properties for the new saved search. For a list of available parameters, see <a href="http://dev.splunk.com/view/SP-CAAAEFA#savedsearchparams" target="_blank">Saved search parameters</a> on Splunk Developer Portal.
@return {splunkjs.Service.SavedSea... | [
"Creates",
"a",
"local",
"instance",
"of",
"a",
"saved",
"search",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4067-L4070 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.StoragePassword(this.service, props.name, entityNamespace);
} | javascript | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.StoragePassword(this.service, props.name, entityNamespace);
} | [
"function",
"(",
"props",
")",
"{",
"var",
"entityNamespace",
"=",
"utils",
".",
"namespaceFromProperties",
"(",
"props",
")",
";",
"return",
"new",
"root",
".",
"StoragePassword",
"(",
"this",
".",
"service",
",",
"props",
".",
"name",
",",
"entityNamespace... | Creates a local instance of a storage password.
@param {Object} props The properties for the new storage password. For a list of available parameters,
see <a href="http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTaccess#POST_storage.2Fpasswords" target="_blank">
POST storage/passwords</a> on Splunk Devel... | [
"Creates",
"a",
"local",
"instance",
"of",
"a",
"storage",
"password",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4156-L4159 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, name, namespace) {
this.name = name;
this._super(service, this.path(), namespace);
this.list = utils.bind(this, this.list);
} | javascript | function(service, name, namespace) {
this.name = name;
this._super(service, this.path(), namespace);
this.list = utils.bind(this, this.list);
} | [
"function",
"(",
"service",
",",
"name",
",",
"namespace",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"_super",
"(",
"service",
",",
"this",
".",
"path",
"(",
")",
",",
"namespace",
")",
";",
"this",
".",
"list",
"=",
"utils",
... | Constructor for `splunkjs.Service.FiredAlertGroup`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} name The name for the new alert group.
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" means no speci... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"FiredAlertGroup",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4423-L4428 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.FiredAlertGroup(this.service, props.name, entityNamespace);
} | javascript | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.FiredAlertGroup(this.service, props.name, entityNamespace);
} | [
"function",
"(",
"props",
")",
"{",
"var",
"entityNamespace",
"=",
"utils",
".",
"namespaceFromProperties",
"(",
"props",
")",
";",
"return",
"new",
"root",
".",
"FiredAlertGroup",
"(",
"this",
".",
"service",
",",
"props",
".",
"name",
",",
"entityNamespace... | Creates a local instance of an alert group.
@param {Object} props The properties for the alert group.
@return {splunkjs.Service.FiredAlertGroup} A new `splunkjs.Service.FiredAlertGroup` instance.
@method splunkjs.Service.FiredAlertGroupCollection | [
"Creates",
"a",
"local",
"instance",
"of",
"an",
"alert",
"group",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4459-L4462 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, namespace) {
this._super(service, this.path(), namespace);
this.instantiateEntity = utils.bind(this, this.instantiateEntity);
this.remove = utils.bind(this, this.remove);
} | javascript | function(service, namespace) {
this._super(service, this.path(), namespace);
this.instantiateEntity = utils.bind(this, this.instantiateEntity);
this.remove = utils.bind(this, this.remove);
} | [
"function",
"(",
"service",
",",
"namespace",
")",
"{",
"this",
".",
"_super",
"(",
"service",
",",
"this",
".",
"path",
"(",
")",
",",
"namespace",
")",
";",
"this",
".",
"instantiateEntity",
"=",
"utils",
".",
"bind",
"(",
"this",
",",
"this",
".",... | Constructor for `splunkjs.Service.FiredAlertGroupCollection`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" means no specific user. The "-" wildcard means all users.
-... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"FiredAlertGroupCollection",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4486-L4491 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, name) {
this.name = name;
this._super(service, this.path(), {});
this.setupInfo = utils.bind(this, this.setupInfo);
this.updateInfo = utils.bind(this, this.updateInfo);
} | javascript | function(service, name) {
this.name = name;
this._super(service, this.path(), {});
this.setupInfo = utils.bind(this, this.setupInfo);
this.updateInfo = utils.bind(this, this.updateInfo);
} | [
"function",
"(",
"service",
",",
"name",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"_super",
"(",
"service",
",",
"this",
".",
"path",
"(",
")",
",",
"{",
"}",
")",
";",
"this",
".",
"setupInfo",
"=",
"utils",
".",
"bind",
"... | Constructor for `splunkjs.Service.Application`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} name The name of the Splunk app.
@return {splunkjs.Service.Application} A new `splunkjs.Service.Application` instance.
@method splunkjs.Service.Application | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"Application",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4530-L4536 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(callback) {
callback = callback || function() {};
var that = this;
return this.get("setup", {}, function(err, response) {
if (err) {
callback(err);
}
else {
callback(null, r... | javascript | function(callback) {
callback = callback || function() {};
var that = this;
return this.get("setup", {}, function(err, response) {
if (err) {
callback(err);
}
else {
callback(null, r... | [
"function",
"(",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"var",
"that",
"=",
"this",
";",
"return",
"this",
".",
"get",
"(",
"\"setup\"",
",",
"{",
"}",
",",
"function",
"(",
"err",
",",
"respon... | Retrieves the setup information for a Splunk app.
@example
var app = service.apps().item("app");
app.setup(function(err, info, search) {
console.log("SETUP INFO: ", info);
});
@param {Function} callback A function to call when setup information is retrieved: `(err, info, app)`.
@endpoint apps/local/{name}/setup
@me... | [
"Retrieves",
"the",
"setup",
"information",
"for",
"a",
"Splunk",
"app",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4553-L4565 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.View(this.service, props.name, entityNamespace);
} | javascript | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.View(this.service, props.name, entityNamespace);
} | [
"function",
"(",
"props",
")",
"{",
"var",
"entityNamespace",
"=",
"utils",
".",
"namespaceFromProperties",
"(",
"props",
")",
";",
"return",
"new",
"root",
".",
"View",
"(",
"this",
".",
"service",
",",
"props",
".",
"name",
",",
"entityNamespace",
")",
... | Creates a local instance of a view.
@param {Object} props The properties for the new view. For a list of available parameters, see the <a href="http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTsearch#POST_scheduled.2Fviews.2F.7Bname.7D" target="_blank">POST scheduled/views/{name}</a> endpoint in the REST... | [
"Creates",
"a",
"local",
"instance",
"of",
"a",
"view",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4870-L4873 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, name, namespace) {
this.name = name;
this._super(service, this.path(), namespace);
this.submitEvent = utils.bind(this, this.submitEvent);
} | javascript | function(service, name, namespace) {
this.name = name;
this._super(service, this.path(), namespace);
this.submitEvent = utils.bind(this, this.submitEvent);
} | [
"function",
"(",
"service",
",",
"name",
",",
"namespace",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"_super",
"(",
"service",
",",
"this",
".",
"path",
"(",
")",
",",
"namespace",
")",
";",
"this",
".",
"submitEvent",
"=",
"uti... | Constructor for `splunkjs.Service.Index`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} name The name of the index.
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" means no specific user. The "-" wil... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"Index",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4924-L4929 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(event, params, callback) {
if (!callback && utils.isFunction(params)) {
callback = params;
params = {};
}
callback = callback || function() {};
params = params || {};
// Add the index name
... | javascript | function(event, params, callback) {
if (!callback && utils.isFunction(params)) {
callback = params;
params = {};
}
callback = callback || function() {};
params = params || {};
// Add the index name
... | [
"function",
"(",
"event",
",",
"params",
",",
"callback",
")",
"{",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"params",
")",
")",
"{",
"callback",
"=",
"params",
";",
"params",
"=",
"{",
"}",
";",
"}",
"callback",
"=",
"cal... | Submits an event to this index.
@example
var index = service.indexes().item("_internal");
index.submitEvent("A new event", {sourcetype: "mysourcetype"}, function(err, result, index) {
console.log("Submitted event: ", result);
});
@param {String} event The text for this event.
@param {Object} params A dictionary of p... | [
"Submits",
"an",
"event",
"to",
"this",
"index",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L4952-L4968 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.Index(this.service, props.name, entityNamespace);
} | javascript | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.Index(this.service, props.name, entityNamespace);
} | [
"function",
"(",
"props",
")",
"{",
"var",
"entityNamespace",
"=",
"utils",
".",
"namespaceFromProperties",
"(",
"props",
")",
";",
"return",
"new",
"root",
".",
"Index",
"(",
"this",
".",
"service",
",",
"props",
".",
"name",
",",
"entityNamespace",
")",
... | Creates a local instance of an index.
@param {Object} props The properties for the new index. For a list of available parameters, see <a href="http://dev.splunk.com/view/SP-CAAAEJ3#indexparams" target="_blank">Index parameters</a> on Splunk Developer Portal.
@return {splunkjs.Service.Index} A new `splunkjs.Service.Ind... | [
"Creates",
"a",
"local",
"instance",
"of",
"an",
"index",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5006-L5009 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(name, params, callback) {
// If someone called us with the default style of (params, callback),
// lets make it work
if (utils.isObject(name) && utils.isFunction(params) && !callback) {
callback = params;
params = name;
name = ... | javascript | function(name, params, callback) {
// If someone called us with the default style of (params, callback),
// lets make it work
if (utils.isObject(name) && utils.isFunction(params) && !callback) {
callback = params;
params = name;
name = ... | [
"function",
"(",
"name",
",",
"params",
",",
"callback",
")",
"{",
"// If someone called us with the default style of (params, callback),",
"// lets make it work",
"if",
"(",
"utils",
".",
"isObject",
"(",
"name",
")",
"&&",
"utils",
".",
"isFunction",
"(",
"params",
... | Creates an index with the given name and parameters.
@example
var indexes = service.indexes();
indexes.create("NewIndex", {assureUTF8: true}, function(err, newIndex) {
console.log("CREATED");
});
@param {String} name A name for this index.
@param {Object} params A dictionary of properties. For a list of available pa... | [
"Creates",
"an",
"index",
"with",
"the",
"given",
"name",
"and",
"parameters",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5045-L5058 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, file, name, namespace) {
this.name = name;
this.file = file;
this._super(service, this.path(), namespace);
} | javascript | function(service, file, name, namespace) {
this.name = name;
this.file = file;
this._super(service, this.path(), namespace);
} | [
"function",
"(",
"service",
",",
"file",
",",
"name",
",",
"namespace",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"file",
"=",
"file",
";",
"this",
".",
"_super",
"(",
"service",
",",
"this",
".",
"path",
"(",
")",
",",
"names... | Constructor for `splunkjs.Service.ConfigurationStanza`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} file The name of the configuration file.
@param {String} name The name of the new stanza.
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk userna... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"ConfigurationStanza",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5095-L5099 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.ConfigurationStanza(this.service, this.name, props.name, entityNamespace);
} | javascript | function(props) {
var entityNamespace = utils.namespaceFromProperties(props);
return new root.ConfigurationStanza(this.service, this.name, props.name, entityNamespace);
} | [
"function",
"(",
"props",
")",
"{",
"var",
"entityNamespace",
"=",
"utils",
".",
"namespaceFromProperties",
"(",
"props",
")",
";",
"return",
"new",
"root",
".",
"ConfigurationStanza",
"(",
"this",
".",
"service",
",",
"this",
".",
"name",
",",
"props",
".... | Creates a local instance of a stanza in a configuration file.
@param {Object} props The key-value properties for the new stanza.
@return {splunkjs.Service.ConfigurationStanza} A new `splunkjs.Service.ConfigurationStanza` instance.
@method splunkjs.Service.ConfigurationFile | [
"Creates",
"a",
"local",
"instance",
"of",
"a",
"stanza",
"in",
"a",
"configuration",
"file",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5143-L5146 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(stanzaName, values, callback) {
// If someone called us with the default style of (params, callback),
// lets make it work
if (utils.isObject(stanzaName) && utils.isFunction(values) && !callback) {
callback = values;
values = stanzaName;
... | javascript | function(stanzaName, values, callback) {
// If someone called us with the default style of (params, callback),
// lets make it work
if (utils.isObject(stanzaName) && utils.isFunction(values) && !callback) {
callback = values;
values = stanzaName;
... | [
"function",
"(",
"stanzaName",
",",
"values",
",",
"callback",
")",
"{",
"// If someone called us with the default style of (params, callback),",
"// lets make it work",
"if",
"(",
"utils",
".",
"isObject",
"(",
"stanzaName",
")",
"&&",
"utils",
".",
"isFunction",
"(",
... | Creates a stanza in this configuration file.
@example
var file = service.configurations().item("props");
file.create("my_stanza", function(err, newStanza) {
console.log("CREATED");
});
@param {String} stanzaName A name for this stanza.
@param {Object} values A dictionary of key-value pairs to put in this stanza.
@pa... | [
"Creates",
"a",
"stanza",
"in",
"this",
"configuration",
"file",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5184-L5202 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, namespace) {
if (!namespace || namespace.owner === "-" || namespace.app === "-") {
throw new Error("Configurations requires a non-wildcard owner/app");
}
this._super(service, this.path(), namespace);
} | javascript | function(service, namespace) {
if (!namespace || namespace.owner === "-" || namespace.app === "-") {
throw new Error("Configurations requires a non-wildcard owner/app");
}
this._super(service, this.path(), namespace);
} | [
"function",
"(",
"service",
",",
"namespace",
")",
"{",
"if",
"(",
"!",
"namespace",
"||",
"namespace",
".",
"owner",
"===",
"\"-\"",
"||",
"namespace",
".",
"app",
"===",
"\"-\"",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Configurations requires a non-wild... | Constructor for `splunkjs.Service.Configurations`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" means no specific user. The "-" wildcard means all users.
- `app` (_st... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"Configurations",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5257-L5263 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(filename, callback) {
// If someone called us with the default style of (params, callback),
// lets make it work
if (utils.isObject(filename)) {
filename = filename["__conf"];
}
callback = callback || function() {};
... | javascript | function(filename, callback) {
// If someone called us with the default style of (params, callback),
// lets make it work
if (utils.isObject(filename)) {
filename = filename["__conf"];
}
callback = callback || function() {};
... | [
"function",
"(",
"filename",
",",
"callback",
")",
"{",
"// If someone called us with the default style of (params, callback),",
"// lets make it work",
"if",
"(",
"utils",
".",
"isObject",
"(",
"filename",
")",
")",
"{",
"filename",
"=",
"filename",
"[",
"\"__conf\"",
... | Creates a configuration file.
@example
var configurations = service.configurations();
configurations.create("myprops", function(err, newFile) {
console.log("CREATED");
});
@param {String} filename A name for this configuration file.
@param {Function} callback A function to call with the new configuration file: `(err... | [
"Creates",
"a",
"configuration",
"file",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5281-L5309 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | 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.bi... | javascript | 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.bi... | [
"function",
"(",
"service",
",",
"sid",
",",
"namespace",
")",
"{",
"this",
".",
"name",
"=",
"sid",
";",
"this",
".",
"_super",
"(",
"service",
",",
"this",
".",
"path",
"(",
")",
",",
"namespace",
")",
";",
"this",
".",
"sid",
"=",
"sid",
";",
... | Constructor for `splunkjs.Service.Job`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {String} sid The search ID for this search job.
@param {Object} namespace Namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" means no specific user. Th... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"Job",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5344-L5366 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(callback) {
callback = callback || function() {};
var that = this;
var req = this.post("control", {action: "enablepreview"}, function(err) {
callback(err, that);
});
return req;
} | javascript | function(callback) {
callback = callback || function() {};
var that = this;
var req = this.post("control", {action: "enablepreview"}, function(err) {
callback(err, that);
});
return req;
} | [
"function",
"(",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"var",
"that",
"=",
"this",
";",
"var",
"req",
"=",
"this",
".",
"post",
"(",
"\"control\"",
",",
"{",
"action",
":",
"\"enablepreview\"",
... | Enables preview generation for a search job.
@example
var job = service.jobs().item("mysid");
job.disablePreview(function(err, job) {
console.log("PREVIEW ENABLED");
});
@param {Function} callback A function to call with this search job: `(err, job)`.
@endpoint search/jobs/{search_id}/control
@method splunkjs.Servi... | [
"Enables",
"preview",
"generation",
"for",
"a",
"search",
"job",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5430-L5439 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | 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... | javascript | 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... | [
"function",
"(",
"params",
",",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"params",
"=",
"params",
"||",
"{",
"}",
";",
"params",
".",
"output_mode",
"=",
"params",
".",
"output_mode",
"||",
"\"json_r... | Returns the events of a search job with given parameters.
@example
var job = service.jobs().item("mysid");
job.events({count: 10}, function(err, events, job) {
console.log("Fields: ", events.fields);
});
@param {Object} params The parameters for retrieving events. For a list of available parameters, see the <a href=... | [
"Returns",
"the",
"events",
"of",
"a",
"search",
"job",
"with",
"given",
"parameters",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5457-L5471 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | 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;
} | javascript | 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;
} | [
"function",
"(",
"value",
",",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"var",
"that",
"=",
"this",
";",
"var",
"req",
"=",
"this",
".",
"post",
"(",
"\"control\"",
",",
"{",
"action",
":",
"\"se... | Sets the priority for this search job.
@example
var job = service.jobs().item("mysid");
job.setPriority(6, function(err, job) {
console.log("JOB PRIORITY SET");
});
@param {Number} value The priority (an integer between 1-10). A higher value means a higher priority.
@param {Function} callback A function to call with... | [
"Sets",
"the",
"priority",
"for",
"this",
"search",
"job",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5654-L5663 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(options, callbacks) {
var period = options.period || 500; // ms
if (utils.isFunction(callbacks)) {
callbacks = {
done: callbacks
};
}
var noCallbacksAfterReady = (
!call... | javascript | function(options, callbacks) {
var period = options.period || 500; // ms
if (utils.isFunction(callbacks)) {
callbacks = {
done: callbacks
};
}
var noCallbacksAfterReady = (
!call... | [
"function",
"(",
"options",
",",
"callbacks",
")",
"{",
"var",
"period",
"=",
"options",
".",
"period",
"||",
"500",
";",
"// ms",
"if",
"(",
"utils",
".",
"isFunction",
"(",
"callbacks",
")",
")",
"{",
"callbacks",
"=",
"{",
"done",
":",
"callbacks",
... | Starts polling the status of this search job, and fires callbacks
upon each status change.
@param {Object} options A dictionary of optional parameters:
- `period` (_integer_): The number of milliseconds to wait between each poll. Defaults to 500.
@param {Object|Function} callbacks A dictionary of optional callbacks:
-... | [
"Starts",
"polling",
"the",
"status",
"of",
"this",
"search",
"job",
"and",
"fires",
"callbacks",
"upon",
"each",
"status",
"change",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5796-L5884 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
var sid = props.content.sid;
var entityNamespace = utils.namespaceFromProperties(props);
return new root.Job(this.service, sid, entityNamespace);
} | javascript | function(props) {
var sid = props.content.sid;
var entityNamespace = utils.namespaceFromProperties(props);
return new root.Job(this.service, sid, entityNamespace);
} | [
"function",
"(",
"props",
")",
"{",
"var",
"sid",
"=",
"props",
".",
"content",
".",
"sid",
";",
"var",
"entityNamespace",
"=",
"utils",
".",
"namespaceFromProperties",
"(",
"props",
")",
";",
"return",
"new",
"root",
".",
"Job",
"(",
"this",
".",
"ser... | Creates a local instance of a job.
@param {Object} props The properties for this new job. For a list of available parameters, see <a href="http://dev.splunk.com/view/SP-CAAAEFA#searchjobparams" target="_blank">Search job parameters</a> on Splunk Developer Portal.
@return {splunkjs.Service.Job} A new `splunkjs.Service.... | [
"Creates",
"a",
"local",
"instance",
"of",
"a",
"job",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L5939-L5943 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(query, params, callback) {
// If someone called us with the default style of (params, callback),
// lets make it work
if (utils.isObject(query) && utils.isFunction(params) && !callback) {
callback = params;
params = query;
quer... | javascript | function(query, params, callback) {
// If someone called us with the default style of (params, callback),
// lets make it work
if (utils.isObject(query) && utils.isFunction(params) && !callback) {
callback = params;
params = query;
quer... | [
"function",
"(",
"query",
",",
"params",
",",
"callback",
")",
"{",
"// If someone called us with the default style of (params, callback),",
"// lets make it work",
"if",
"(",
"utils",
".",
"isObject",
"(",
"query",
")",
"&&",
"utils",
".",
"isFunction",
"(",
"params"... | Creates a oneshot search from a given search query and parameters.
@example
var jobs = service.jobs();
jobs.oneshotSearch("search ERROR", {id: "myjob_123"}, function(err, results) {
console.log("RESULT FIELDS": results.fields);
});
@param {String} query The search query.
@param {Object} params A dictionary of proper... | [
"Creates",
"a",
"oneshot",
"search",
"from",
"a",
"given",
"search",
"query",
"and",
"parameters",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6066-L6111 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
props = props || {};
props.owner = props.owner || "";
this.name = props.fieldName;
this.displayName = props.displayName;
this.type = props.type;
this.multivalued = props.multivalue;
this.requ... | javascript | function(props) {
props = props || {};
props.owner = props.owner || "";
this.name = props.fieldName;
this.displayName = props.displayName;
this.type = props.type;
this.multivalued = props.multivalue;
this.requ... | [
"function",
"(",
"props",
")",
"{",
"props",
"=",
"props",
"||",
"{",
"}",
";",
"props",
".",
"owner",
"=",
"props",
".",
"owner",
"||",
"\"\"",
";",
"this",
".",
"name",
"=",
"props",
".",
"fieldName",
";",
"this",
".",
"displayName",
"=",
"props"... | Constructor for a data model field.
SDK users are not expected to invoke this constructor directly.
@constructor
@param {Object} props A dictionary of properties to set:
- `fieldName` (_string_): The name of this field.
- `displayName` (_string_): A human readable name for this field.
- `type` (_string_): The type of ... | [
"Constructor",
"for",
"a",
"data",
"model",
"field",
".",
"SDK",
"users",
"are",
"not",
"expected",
"to",
"invoke",
"this",
"constructor",
"directly",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6168-L6183 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
props = props || {};
props.owner = props.owner || "";
this.query = props.search;
this.lineage = props.owner.split(".");
this.owner = this.lineage[this.lineage.length - 1];
} | javascript | function(props) {
props = props || {};
props.owner = props.owner || "";
this.query = props.search;
this.lineage = props.owner.split(".");
this.owner = this.lineage[this.lineage.length - 1];
} | [
"function",
"(",
"props",
")",
"{",
"props",
"=",
"props",
"||",
"{",
"}",
";",
"props",
".",
"owner",
"=",
"props",
".",
"owner",
"||",
"\"\"",
";",
"this",
".",
"query",
"=",
"props",
".",
"search",
";",
"this",
".",
"lineage",
"=",
"props",
".... | Constructor for a data model constraint.
SDK users are not expected to invoke this constructor directly.
@constructor
@param {Object} props A dictionary of properties to set:
- `search` (_string_): The Splunk search query this constraint specifies.
- `owner` (_string_): The lineage of the data model object that owns t... | [
"Constructor",
"for",
"a",
"data",
"model",
"constraint",
".",
"SDK",
"users",
"are",
"not",
"expected",
"to",
"invoke",
"this",
"constructor",
"directly",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6288-L6295 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props) {
props = props || {};
props.owner = props.owner || "";
this.id = props.calculationID;
this.type = props.calculationType;
this.comment = props.comment || null;
this.editable = props.editable;
... | javascript | function(props) {
props = props || {};
props.owner = props.owner || "";
this.id = props.calculationID;
this.type = props.calculationType;
this.comment = props.comment || null;
this.editable = props.editable;
... | [
"function",
"(",
"props",
")",
"{",
"props",
"=",
"props",
"||",
"{",
"}",
";",
"props",
".",
"owner",
"=",
"props",
".",
"owner",
"||",
"\"\"",
";",
"this",
".",
"id",
"=",
"props",
".",
"calculationID",
";",
"this",
".",
"type",
"=",
"props",
"... | Constructor for a data model calculation.
SDK users are not expected to invoke this constructor directly.
@constructor
@param {Object} props A dictionary of properties to set:
- `calculationID` (_string_): The ID of this calculation.
- `calculationType` (_string_): The type of this calculation, see class docs for vali... | [
"Constructor",
"for",
"a",
"data",
"model",
"calculation",
".",
"SDK",
"users",
"are",
"not",
"expected",
"to",
"invoke",
"this",
"constructor",
"directly",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6354-L6380 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, props) {
this.service = service;
this.search = props.search;
this.drilldownSearch = props.drilldown_search;
this.prettyQuery = this.openInSearch = props.open_in_search;
this.pivotSearch = props.pivot_search;
this.tstatsSearch = pr... | javascript | function(service, props) {
this.service = service;
this.search = props.search;
this.drilldownSearch = props.drilldown_search;
this.prettyQuery = this.openInSearch = props.open_in_search;
this.pivotSearch = props.pivot_search;
this.tstatsSearch = pr... | [
"function",
"(",
"service",
",",
"props",
")",
"{",
"this",
".",
"service",
"=",
"service",
";",
"this",
".",
"search",
"=",
"props",
".",
"search",
";",
"this",
".",
"drilldownSearch",
"=",
"props",
".",
"drilldown_search",
";",
"this",
".",
"prettyQuer... | Constructor for a pivot.
SDK users are not expected to invoke this constructor directly.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {Object} props A dictionary of properties to set:
- `search` (_string_): The search string for running the pivot report.
- `drilldown_search` (_string_): ... | [
"Constructor",
"for",
"a",
"pivot",
".",
"SDK",
"users",
"are",
"not",
"expected",
"to",
"invoke",
"this",
"constructor",
"directly",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6479-L6488 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(args, callback) {
if (utils.isUndefined(callback)) {
callback = args;
args = {};
}
if (!args || Object.keys(args).length === 0) {
args = {};
}
// If tstats is undefined, use pivotSearch (try to run an a... | javascript | function(args, callback) {
if (utils.isUndefined(callback)) {
callback = args;
args = {};
}
if (!args || Object.keys(args).length === 0) {
args = {};
}
// If tstats is undefined, use pivotSearch (try to run an a... | [
"function",
"(",
"args",
",",
"callback",
")",
"{",
"if",
"(",
"utils",
".",
"isUndefined",
"(",
"callback",
")",
")",
"{",
"callback",
"=",
"args",
";",
"args",
"=",
"{",
"}",
";",
"}",
"if",
"(",
"!",
"args",
"||",
"Object",
".",
"keys",
"(",
... | Starts a search job running this pivot, accelerated if possible.
@param {Object} args A dictionary of properties for the search job (optional). For a list of available parameters, see <a href="http://dev.splunk.com/view/SP-CAAAEFA#searchjobparams" target="_blank">Search job parameters</a> on Splunk Developer Portal.
*... | [
"Starts",
"a",
"search",
"job",
"running",
"this",
"pivot",
"accelerated",
"if",
"possible",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6498-L6509 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(dataModelObject) {
this.dataModelObject = dataModelObject;
this.columns = [];
this.rows = [];
this.filters = [];
this.cells = [];
this.accelerationNamespace = dataModelObject.dataModel.isAccelerated() ?
dataModelObject.da... | javascript | function(dataModelObject) {
this.dataModelObject = dataModelObject;
this.columns = [];
this.rows = [];
this.filters = [];
this.cells = [];
this.accelerationNamespace = dataModelObject.dataModel.isAccelerated() ?
dataModelObject.da... | [
"function",
"(",
"dataModelObject",
")",
"{",
"this",
".",
"dataModelObject",
"=",
"dataModelObject",
";",
"this",
".",
"columns",
"=",
"[",
"]",
";",
"this",
".",
"rows",
"=",
"[",
"]",
";",
"this",
".",
"filters",
"=",
"[",
"]",
";",
"this",
".",
... | Constructor for a pivot specification.
@constructor
@param {splunkjs.Service.DataModel} parentDataModel The `DataModel` that owns this data model object.
@method splunkjs.Service.PivotSpecification | [
"Constructor",
"for",
"a",
"pivot",
"specification",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6640-L6652 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(sid) {
// If a search object is passed in, get its sid
if (sid && sid instanceof Service.Job) {
sid = sid.sid;
}
if (!sid) {
throw new Error("Sid to use for acceleration must not be null.");
}
... | javascript | function(sid) {
// If a search object is passed in, get its sid
if (sid && sid instanceof Service.Job) {
sid = sid.sid;
}
if (!sid) {
throw new Error("Sid to use for acceleration must not be null.");
}
... | [
"function",
"(",
"sid",
")",
"{",
"// If a search object is passed in, get its sid",
"if",
"(",
"sid",
"&&",
"sid",
"instanceof",
"Service",
".",
"Job",
")",
"{",
"sid",
"=",
"sid",
".",
"sid",
";",
"}",
"if",
"(",
"!",
"sid",
")",
"{",
"throw",
"new",
... | Set the acceleration cache for this pivot specification to a job,
usually generated by createLocalAccelerationJob on a DataModelObject
instance, as the acceleration cache for this pivot specification.
@param {String|splunkjs.Service.Job} sid The sid of an acceleration job,
or, a `splunkjs.Service.Job` instance.
@retur... | [
"Set",
"the",
"acceleration",
"cache",
"for",
"this",
"pivot",
"specification",
"to",
"a",
"job",
"usually",
"generated",
"by",
"createLocalAccelerationJob",
"on",
"a",
"DataModelObject",
"instance",
"as",
"the",
"acceleration",
"cache",
"for",
"this",
"pivot",
"s... | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6665-L6677 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(fieldName, sortAttribute, sortDirection, limit, statsFunction) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Cannot add limit filter on a nonexistent field.");
}
var f = this.dataModelObject.fieldByName(fieldName);
if (!uti... | javascript | function(fieldName, sortAttribute, sortDirection, limit, statsFunction) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Cannot add limit filter on a nonexistent field.");
}
var f = this.dataModelObject.fieldByName(fieldName);
if (!uti... | [
"function",
"(",
"fieldName",
",",
"sortAttribute",
",",
"sortDirection",
",",
"limit",
",",
"statsFunction",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"hasField",
"(",
"fieldName",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Canno... | Add a limit on the events shown in a pivot by sorting them according to some field, then taking
the specified number from the beginning or end of the list.
@param {String} fieldName The name of field to filter on.
@param {String} sortAttribute The name of the field to use for sorting.
@param {String} sortDirection The... | [
"Add",
"a",
"limit",
"on",
"the",
"events",
"shown",
"in",
"a",
"pivot",
"by",
"sorting",
"them",
"according",
"to",
"some",
"field",
"then",
"taking",
"the",
"specified",
"number",
"from",
"the",
"beginning",
"or",
"end",
"of",
"the",
"list",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6739-L6779 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(fieldName, label) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if (!utils.contains(["number", "string"], f.type)) {
th... | javascript | function(fieldName, label) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if (!utils.contains(["number", "string"], f.type)) {
th... | [
"function",
"(",
"fieldName",
",",
"label",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"hasField",
"(",
"fieldName",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Did not find field \"",
"+",
"fieldName",
")",
";",
"}",
"var",
"f",
... | Add a row split on a numeric or string valued field, splitting on each distinct value of the field.
@param {String} fieldName The name of field to split on.
@param {String} label A human readable name for this set of rows.
@return {splunkjs.Service.PivotSpecification} The updated pivot specification.
@method splunkjs... | [
"Add",
"a",
"row",
"split",
"on",
"a",
"numeric",
"or",
"string",
"valued",
"field",
"splitting",
"on",
"each",
"distinct",
"value",
"of",
"the",
"field",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6790-L6813 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(field, label, ranges) {
if (!this.dataModelObject.hasField(field)) {
throw new Error("Did not find field " + field);
}
var f = this.dataModelObject.fieldByName(field);
if ("number" !== f.type) {
throw new Error("Field was of type "... | javascript | function(field, label, ranges) {
if (!this.dataModelObject.hasField(field)) {
throw new Error("Did not find field " + field);
}
var f = this.dataModelObject.fieldByName(field);
if ("number" !== f.type) {
throw new Error("Field was of type "... | [
"function",
"(",
"field",
",",
"label",
",",
"ranges",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"hasField",
"(",
"field",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Did not find field \"",
"+",
"field",
")",
";",
"}",
"var",
... | Add a row split on a numeric field, splitting into numeric ranges.
This split generates bins with edges equivalent to the
classic loop 'for i in <start> to <end> by <step>' but with a maximum
number of bins <limit>. This dispatches to the stats and xyseries search commands.
See their documentation for more details.
@... | [
"Add",
"a",
"row",
"split",
"on",
"a",
"numeric",
"field",
"splitting",
"into",
"numeric",
"ranges",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6834-L6866 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(field, label, trueDisplayValue, falseDisplayValue) {
if (!this.dataModelObject.fieldByName(field)) {
throw new Error("Did not find field " + field);
}
var f = this.dataModelObject.fieldByName(field);
if ("boolean" !== f.type) {
thr... | javascript | function(field, label, trueDisplayValue, falseDisplayValue) {
if (!this.dataModelObject.fieldByName(field)) {
throw new Error("Did not find field " + field);
}
var f = this.dataModelObject.fieldByName(field);
if ("boolean" !== f.type) {
thr... | [
"function",
"(",
"field",
",",
"label",
",",
"trueDisplayValue",
",",
"falseDisplayValue",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"fieldByName",
"(",
"field",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Did not find field \"",
"+"... | Add a row split on a boolean valued field.
@param {String} fieldName The name of field to split on.
@param {String} label A human readable name for this set of rows.
@param {String} trueDisplayValue A string to display in the true valued row label.
@param {String} falseDisplayValue A string to display in the false val... | [
"Add",
"a",
"row",
"split",
"on",
"a",
"boolean",
"valued",
"field",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6879-L6898 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(fieldName) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if (!utils.contains(["number", "string"], f.type)) {
throw new... | javascript | function(fieldName) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if (!utils.contains(["number", "string"], f.type)) {
throw new... | [
"function",
"(",
"fieldName",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"hasField",
"(",
"fieldName",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Did not find field \"",
"+",
"fieldName",
")",
";",
"}",
"var",
"f",
"=",
"this",
... | Add a column split on a string or number valued field, producing a column for
each distinct value of the field.
@param {String} fieldName The name of field to split on.
@return {splunkjs.Service.PivotSpecification} The updated pivot specification.
@method splunkjs.Service.PivotSpecification | [
"Add",
"a",
"column",
"split",
"on",
"a",
"string",
"or",
"number",
"valued",
"field",
"producing",
"a",
"column",
"for",
"each",
"distinct",
"value",
"of",
"the",
"field",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6942-L6964 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(fieldName, ranges) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if ("number" !== f.type) {
throw new Error("Field was ... | javascript | function(fieldName, ranges) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if ("number" !== f.type) {
throw new Error("Field was ... | [
"function",
"(",
"fieldName",
",",
"ranges",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"hasField",
"(",
"fieldName",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Did not find field \"",
"+",
"fieldName",
")",
";",
"}",
"var",
"f",... | Add a column split on a numeric field, splitting the values into ranges.
@param {String} fieldName The field to split on.
@param {Object} options An optional dictionary of collection filtering and pagination options:
- `start` (_integer_): The value of the start of the first range, or null to take the lowest value in ... | [
"Add",
"a",
"column",
"split",
"on",
"a",
"numeric",
"field",
"splitting",
"the",
"values",
"into",
"ranges",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L6979-L7013 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(fieldName, trueDisplayValue, falseDisplayValue) {
if (!this.dataModelObject.fieldByName(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if ("boolean" !== f.type) {
... | javascript | function(fieldName, trueDisplayValue, falseDisplayValue) {
if (!this.dataModelObject.fieldByName(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if ("boolean" !== f.type) {
... | [
"function",
"(",
"fieldName",
",",
"trueDisplayValue",
",",
"falseDisplayValue",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"fieldByName",
"(",
"fieldName",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Did not find field \"",
"+",
"field... | Add a column split on a boolean valued field.
@param {String} fieldName The name of field to split on.
@param {String} trueDisplayValue A string to display in the true valued column label.
@param {String} falseDisplayValue A string to display in the false valued column label.
@return {splunkjs.Service.PivotSpecificati... | [
"Add",
"a",
"column",
"split",
"on",
"a",
"boolean",
"valued",
"field",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7025-L7043 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(field, binning) {
if (!this.dataModelObject.hasField(field)) {
throw new Error("Did not find field " + field);
}
var f = this.dataModelObject.fieldByName(field);
if ("timestamp" !== f.type) {
throw new Error("Field was of type " + ... | javascript | function(field, binning) {
if (!this.dataModelObject.hasField(field)) {
throw new Error("Did not find field " + field);
}
var f = this.dataModelObject.fieldByName(field);
if ("timestamp" !== f.type) {
throw new Error("Field was of type " + ... | [
"function",
"(",
"field",
",",
"binning",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"hasField",
"(",
"field",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Did not find field \"",
"+",
"field",
")",
";",
"}",
"var",
"f",
"=",
"... | Add a column split on a timestamp valued field, binned by the specified bucket size.
@param {String} fieldName The name of field to split on.
@param {String} binning The size of bins to use, see class docs for valid types.
@return {splunkjs.Service.PivotSpecification} The updated pivot specification.
@method splunkjs... | [
"Add",
"a",
"column",
"split",
"on",
"a",
"timestamp",
"valued",
"field",
"binned",
"by",
"the",
"specified",
"bucket",
"size",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7054-L7074 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(fieldName, label, statsFunction) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if (utils.contains(["string", "ipv4"], f.type) &&
... | javascript | function(fieldName, label, statsFunction) {
if (!this.dataModelObject.hasField(fieldName)) {
throw new Error("Did not find field " + fieldName);
}
var f = this.dataModelObject.fieldByName(fieldName);
if (utils.contains(["string", "ipv4"], f.type) &&
... | [
"function",
"(",
"fieldName",
",",
"label",
",",
"statsFunction",
")",
"{",
"if",
"(",
"!",
"this",
".",
"dataModelObject",
".",
"hasField",
"(",
"fieldName",
")",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Did not find field \"",
"+",
"fieldName",
")",
";... | Add an aggregate to each cell of the pivot.
@param {String} fieldName The name of field to aggregate.
@param {String} label a human readable name for this aggregate.
@param {String} statsFunction The function to use for aggregation, see class docs for valid stats functions.
@return {splunkjs.Service.PivotSpecification... | [
"Add",
"an",
"aggregate",
"to",
"each",
"cell",
"of",
"the",
"pivot",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7086-L7156 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function() {
return {
dataModel: this.dataModelObject.dataModel.name,
baseClass: this.dataModelObject.name,
rows: this.rows,
columns: this.columns,
cells: this.cells,
filters: this.filters
};
... | javascript | function() {
return {
dataModel: this.dataModelObject.dataModel.name,
baseClass: this.dataModelObject.name,
rows: this.rows,
columns: this.columns,
cells: this.cells,
filters: this.filters
};
... | [
"function",
"(",
")",
"{",
"return",
"{",
"dataModel",
":",
"this",
".",
"dataModelObject",
".",
"dataModel",
".",
"name",
",",
"baseClass",
":",
"this",
".",
"dataModelObject",
".",
"name",
",",
"rows",
":",
"this",
".",
"rows",
",",
"columns",
":",
"... | Returns a JSON ready object representation of this pivot specification.
@return {Object} The JSON ready object representation of this pivot specification.
@method splunkjs.Service.PivotSpecification | [
"Returns",
"a",
"JSON",
"ready",
"object",
"representation",
"of",
"this",
"pivot",
"specification",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7165-L7174 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(callback) {
var svc = this.dataModelObject.dataModel.service;
var args = {
pivot_json: JSON.stringify(this.toJsonObject())
};
if (!utils.isUndefined(this.accelerationNamespace)) {
args.namespace = this.accelerationNamespace;
... | javascript | function(callback) {
var svc = this.dataModelObject.dataModel.service;
var args = {
pivot_json: JSON.stringify(this.toJsonObject())
};
if (!utils.isUndefined(this.accelerationNamespace)) {
args.namespace = this.accelerationNamespace;
... | [
"function",
"(",
"callback",
")",
"{",
"var",
"svc",
"=",
"this",
".",
"dataModelObject",
".",
"dataModel",
".",
"service",
";",
"var",
"args",
"=",
"{",
"pivot_json",
":",
"JSON",
".",
"stringify",
"(",
"this",
".",
"toJsonObject",
"(",
")",
")",
"}",... | Query Splunk for SPL queries corresponding to a pivot report
for this data model, defined by this `PivotSpecification`.
@example
service.dataModels().fetch(function(err, dataModels) {
var searches = dataModels.item("internal_audit_logs").objectByName("searches");
var pivotSpec = searches.createPivotSpecification();
/... | [
"Query",
"Splunk",
"for",
"SPL",
"queries",
"corresponding",
"to",
"a",
"pivot",
"report",
"for",
"this",
"data",
"model",
"defined",
"by",
"this",
"PivotSpecification",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7198-L7222 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props, parentDataModel) {
props = props || {};
props.owner = props.owner || "";
this.dataModel = parentDataModel;
this.name = props.objectName;
this.displayName = props.displayName;
this.parentNam... | javascript | function(props, parentDataModel) {
props = props || {};
props.owner = props.owner || "";
this.dataModel = parentDataModel;
this.name = props.objectName;
this.displayName = props.displayName;
this.parentNam... | [
"function",
"(",
"props",
",",
"parentDataModel",
")",
"{",
"props",
"=",
"props",
"||",
"{",
"}",
";",
"props",
".",
"owner",
"=",
"props",
".",
"owner",
"||",
"\"\"",
";",
"this",
".",
"dataModel",
"=",
"parentDataModel",
";",
"this",
".",
"name",
... | Constructor for a data model object.
SDK users are not expected to invoke this constructor directly.
@constructor
@param {Object} props A dictionary of properties to set:
- `objectName` (_string_): The name for this data model object.
- `displayName` (_string_): A human readable name for this data model object.
- `par... | [
"Constructor",
"for",
"a",
"data",
"model",
"object",
".",
"SDK",
"users",
"are",
"not",
"expected",
"to",
"invoke",
"this",
"constructor",
"directly",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7321-L7367 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function() {
// merge fields and calculatedFields()
var combinedFields = [];
for (var f in this.fields) {
if (this.fields.hasOwnProperty(f)) {
combinedFields[f] = this.fields[f];
}
}
var calculatedFields = ... | javascript | function() {
// merge fields and calculatedFields()
var combinedFields = [];
for (var f in this.fields) {
if (this.fields.hasOwnProperty(f)) {
combinedFields[f] = this.fields[f];
}
}
var calculatedFields = ... | [
"function",
"(",
")",
"{",
"// merge fields and calculatedFields()",
"var",
"combinedFields",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"f",
"in",
"this",
".",
"fields",
")",
"{",
"if",
"(",
"this",
".",
"fields",
".",
"hasOwnProperty",
"(",
"f",
")",
")",
... | Returns an array of data model fields from this data model object's
calculations, and this data model object's fields.
@return {Array} An array of `splunk.Service.DataModelField` objects
which includes this data model object's fields, and the fields from
this data model object's calculations.
@method splunkjs.Service... | [
"Returns",
"an",
"array",
"of",
"data",
"model",
"fields",
"from",
"this",
"data",
"model",
"object",
"s",
"calculations",
"and",
"this",
"data",
"model",
"object",
"s",
"fields",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7427-L7445 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(){
var fields = {};
// Iterate over the calculations, get their fields
var keys = this.calculationIDs();
var calculations = this.calculations;
for (var i = 0; i < keys.length; i++) {
var calculation = calculations[keys[i]];
... | javascript | function(){
var fields = {};
// Iterate over the calculations, get their fields
var keys = this.calculationIDs();
var calculations = this.calculations;
for (var i = 0; i < keys.length; i++) {
var calculation = calculations[keys[i]];
... | [
"function",
"(",
")",
"{",
"var",
"fields",
"=",
"{",
"}",
";",
"// Iterate over the calculations, get their fields",
"var",
"keys",
"=",
"this",
".",
"calculationIDs",
"(",
")",
";",
"var",
"calculations",
"=",
"this",
".",
"calculations",
";",
"for",
"(",
... | Returns an array of data model fields from this data model object's
calculations.
@return {Array} An array of `splunk.Service.DataModelField` objects
of the fields from this data model object's calculations.
@method splunkjs.Service.DataModelObject | [
"Returns",
"an",
"array",
"of",
"data",
"model",
"fields",
"from",
"this",
"data",
"model",
"object",
"s",
"calculations",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7470-L7482 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(earliestTime, callback) {
// If earliestTime parameter is not specified, then set callback to its value
if (!callback && utils.isFunction(earliestTime)) {
callback = earliestTime;
earliestTime = undefined;
}
var query = "| datamod... | javascript | function(earliestTime, callback) {
// If earliestTime parameter is not specified, then set callback to its value
if (!callback && utils.isFunction(earliestTime)) {
callback = earliestTime;
earliestTime = undefined;
}
var query = "| datamod... | [
"function",
"(",
"earliestTime",
",",
"callback",
")",
"{",
"// If earliestTime parameter is not specified, then set callback to its value",
"if",
"(",
"!",
"callback",
"&&",
"utils",
".",
"isFunction",
"(",
"earliestTime",
")",
")",
"{",
"callback",
"=",
"earliestTime"... | Local acceleration is tsidx acceleration of a data model object that is handled
manually by a user. You create a job which generates an index, and then use that
index in your pivots on the data model object.
The namespace created by the job is 'sid={sid}' where {sid} is the job's sid. You
would use it in another job b... | [
"Local",
"acceleration",
"is",
"tsidx",
"acceleration",
"of",
"a",
"data",
"model",
"object",
"that",
"is",
"handled",
"manually",
"by",
"a",
"user",
".",
"You",
"create",
"a",
"job",
"which",
"generates",
"an",
"index",
"and",
"then",
"use",
"that",
"inde... | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7549-L7560 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(params, querySuffix, callback) {
var query = "| datamodel " + this.dataModel.name + " " + this.name + " search";
// Prepend a space to the querySuffix, or set it to an empty string if null or undefined
querySuffix = (querySuffix) ? (" " + querySuffix) : ("");
thi... | javascript | function(params, querySuffix, callback) {
var query = "| datamodel " + this.dataModel.name + " " + this.name + " search";
// Prepend a space to the querySuffix, or set it to an empty string if null or undefined
querySuffix = (querySuffix) ? (" " + querySuffix) : ("");
thi... | [
"function",
"(",
"params",
",",
"querySuffix",
",",
"callback",
")",
"{",
"var",
"query",
"=",
"\"| datamodel \"",
"+",
"this",
".",
"dataModel",
".",
"name",
"+",
"\" \"",
"+",
"this",
".",
"name",
"+",
"\" search\"",
";",
"// Prepend a space to the querySuff... | Start a search job that applies querySuffix to all the events in this data model object.
@example
service.dataModels().fetch(function(err, dataModels) {
var object = dataModels.item("internal_audit_logs").objectByName("searches");
object.startSearch({}, "| head 5", function(err, job) {
console.log("The job has name:"... | [
"Start",
"a",
"search",
"job",
"that",
"applies",
"querySuffix",
"to",
"all",
"the",
"events",
"in",
"this",
"data",
"model",
"object",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7581-L7586 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(name) {
for (var i = 0; i < this.objects.length; i++) {
if (this.objects[i].name === name) {
return this.objects[i];
}
}
return null;
} | javascript | function(name) {
for (var i = 0; i < this.objects.length; i++) {
if (this.objects[i].name === name) {
return this.objects[i];
}
}
return null;
} | [
"function",
"(",
"name",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"objects",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
".",
"objects",
"[",
"i",
"]",
".",
"name",
"===",
"name",
")",
"{",
"re... | Returns a data model object from this data model
with the specified name if it exists, null otherwise.
@return {Object|null} a data model object.
@method splunkjs.Service.DataModel | [
"Returns",
"a",
"data",
"model",
"object",
"from",
"this",
"data",
"model",
"with",
"the",
"specified",
"name",
"if",
"it",
"exists",
"null",
"otherwise",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7709-L7716 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(props, callback) {
if (utils.isUndefined(callback)) {
callback = props;
props = {};
}
callback = callback || function() {};
if (!props) {
callback(new Error("Must specify a props argument to update a data model."))... | javascript | function(props, callback) {
if (utils.isUndefined(callback)) {
callback = props;
props = {};
}
callback = callback || function() {};
if (!props) {
callback(new Error("Must specify a props argument to update a data model."))... | [
"function",
"(",
"props",
",",
"callback",
")",
"{",
"if",
"(",
"utils",
".",
"isUndefined",
"(",
"callback",
")",
")",
"{",
"callback",
"=",
"props",
";",
"props",
"=",
"{",
"}",
";",
"}",
"callback",
"=",
"callback",
"||",
"function",
"(",
")",
"... | Updates the data model on the server, used to update acceleration settings.
@param {Object} props A dictionary of properties to update the object with:
- `acceleration` (_object_): The acceleration settings for the data model.
Valid keys are: `enabled`, `earliestTime`, `cronSchedule`.
Any keys not set will be pulled f... | [
"Updates",
"the",
"data",
"model",
"on",
"the",
"server",
"used",
"to",
"update",
"acceleration",
"settings",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7741-L7775 | train | |
splunk/splunk-sdk-javascript | client/splunk.js | function(service, namespace) {
namespace = namespace || {};
this._super(service, this.path(), namespace);
this.create = utils.bind(this, this.create);
} | javascript | function(service, namespace) {
namespace = namespace || {};
this._super(service, this.path(), namespace);
this.create = utils.bind(this, this.create);
} | [
"function",
"(",
"service",
",",
"namespace",
")",
"{",
"namespace",
"=",
"namespace",
"||",
"{",
"}",
";",
"this",
".",
"_super",
"(",
"service",
",",
"this",
".",
"path",
"(",
")",
",",
"namespace",
")",
";",
"this",
".",
"create",
"=",
"utils",
... | Constructor for `splunkjs.Service.DataModels`.
@constructor
@param {splunkjs.Service} service A `Service` instance.
@param {Object} namespace (Optional) namespace information:
- `owner` (_string_): The Splunk username, such as "admin". A value of "nobody" means no specific user. The "-" wildcard means all users.
- `ap... | [
"Constructor",
"for",
"splunkjs",
".",
"Service",
".",
"DataModels",
"."
] | 9aec5443860926654c2ab8ee3bf198a407c53b07 | https://github.com/splunk/splunk-sdk-javascript/blob/9aec5443860926654c2ab8ee3bf198a407c53b07/client/splunk.js#L7809-L7813 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.