Represents a collection of entities accessible through Splunk's REST API.

package Splunk

 Methods

Creates a new entity in this collection.

create(string $name, array $args) : \Splunk_Entity

Parameters

$name

string

The name of the entity to create.

$args

array

(optional) Entity-specific creation arguments, merged with {
namespace: (optional) {Splunk_Namespace} The namespace in which to create the entity. Defaults to the service's namespace.
}

Exceptions

\Splunk_IOException

Returns

Deletes an entity from this collection.

delete(string $name, array $args) 

Parameters

$name

string

The name of the entity to delete.

$args

array

(optional) Entity-specific deletion arguments, merged with {
namespace: (optional) {Splunk_Namespace} The namespace in which to find the entity. Defaults to the service's namespace.
}

Exceptions

\Splunk_IOException

Returns the unique entity with the specified name in this collection.

get(string $name, \Splunk_Namespace | NULL $namespace) : \Splunk_Entity

Parameters

$name

string

The name of the entity to search for.

$namespace

\Splunk_NamespaceNULL

(optional) {Splunk_Namespace} The namespace in which to search. Defaults to the service's namespace.

Exceptions

\Splunk_NoSuchEntityException If no such entity exists.
\Splunk_AmbiguousEntityNameException If multiple entities with the specified name exist in the specified namespace.
\Splunk_IOException

Returns

Returns a reference to the unique entity with the specified name in this collection.

getReference(string $name, \Splunk_Namespace | NULL $namespace) : \Splunk_Entity

Loading of the entity is deferred until its first use.

Parameters

$name

string

The name of the entity to search for.

$namespace

\Splunk_NamespaceNULL

(optional) {Splunk_Namespace} The namespace in which to search. Defaults to the service's namespace.

Returns

Lists this collection's entities, returning a list of loaded entities.

items(array $args) : array

By default, all items in the collection are returned. For large collections, it is advisable to fetch items using multiple calls with the paging options (i.e. 'offset' and 'count').

Parameters

$args

array

(optional) {
namespace: (optional) {Splunk_Namespace} The namespace in which to list entities. Defaults to the service's namespace.
count: (optional) The maximum number of items to return, or -1 to return as many as possible. Defaults to returning as many as possible.
offset: (optional) The offset of the first item to return. Defaults to 0.
search: (optional) The search expression to filter responses with. For example, "foo" matches any object that has "foo" in a substring of a field. Similarly the expression "field_name=field_value" matches only objects that have a "field_name" field with the value "field_value".
sort_dir: (optional) The direction to sort returned items.
Valid values:
- "asc": Sort in ascending order.
- "desc": Sort in descending order.
Defaults to "asc".
sort_key: (optional) The field to use for sorting. Defaults to "name".
sort_mode: (optional) The sorting algorithm to use. Valid values:
- "auto": If all values of the field are numbers, sort numerically. Otherwise, sort alphabetically.
- "alpha": Sort alphabetically.
- "alpha_case": Sort alphabetically, case-sensitive.
- "num": Sort numerically.
Defaults to "auto".
}

Exceptions

\Splunk_IOException

Returns

arraythe entities in the listing.

Sends an HTTP DELETE request relative to this endpoint.

sendDelete(string $relativePath, array $args) : \Splunk_HttpResponse
Inherited
see \Splunk_Http::delete()
inherited_from \Splunk_Endpoint::sendDelete()

Parameters

$relativePath

string

relative URL path.

$args

array

(optional) query parameters, merged with {
namespace: (optional) namespace to use, or NULL to use the context's default namespace.
}

Exceptions

\Splunk_IOException

Returns

\Splunk_HttpResponse

Sends an HTTP GET request relative to this endpoint.

sendGet(string $relativePath, array $args) : \Splunk_HttpResponse
Inherited
see \Splunk_Http::get()
inherited_from \Splunk_Endpoint::sendGet()

Parameters

$relativePath

string

relative URL path.

$args

array

(optional) query parameters, merged with {
namespace: (optional) namespace to use, or NULL to use the context's default namespace.
}

Exceptions

\Splunk_IOException

Returns

\Splunk_HttpResponse

Sends an HTTP POST request relative to this endpoint.

sendPost(string $relativePath, array $args) : \Splunk_HttpResponse
Inherited
see \Splunk_Http::post()
inherited_from \Splunk_Endpoint::sendPost()

Parameters

$relativePath

string

relative URL path.

$args

array

(optional) form parameters to send in the request body, merged with {
namespace: (optional) namespace to use, or NULL to use the context's default namespace.
}

Exceptions

\Splunk_IOException

Returns

\Splunk_HttpResponse

Ensures that the specified name is not NULL or empty.

checkName($name) 

Parameters

$name

Ensures that the specified namespace is a Splunk_Namespace if it is not NULL.

checkNamespace($namespace) 

Parameters

$namespace

Not implemented.

getSearchNamespace() : \Splunk_Namespace | NULL

Returns

\Splunk_NamespaceNULLThe namespace in which this endpoint resides, or NULL to use the context's default namespace. Possibly a non-exact namespace.

Returns the absolute path of the child entity with the specified name.

getEntityPath($name) 

Parameters

$name

Returns the relative path of the child entity with the specified name.

getEntityRelativePath($name) 

Parameters

$name

Returns an array of entities from the given response.

loadEntitiesFromResponse($response) : array

Parameters

$response

Returns

arrayarray of Splunk_Entry.

Returns an entity from the given entry element.

loadEntityFromEntry(\SimpleXMLElement $entry) : \Splunk_Entry

Parameters

$entry

\SimpleXMLElement

an element.

Returns

\Splunk_Entry

Sends a simple request relative to this endpoint.

sendSimpleRequest($method, $relativePath, $args) 
Inherited
inherited_from \Splunk_Endpoint::sendSimpleRequest()

Parameters

$method

$relativePath

$args

 Properties

 

$path 
Inherited
inherited_from \Splunk_Endpoint::$$path
 

$service 
Inherited
inherited_from \Splunk_Endpoint::$$service
 

$entitySubclass