|
34 | 34 | :class:`Service` class, which encapsulates a connection to the server, and |
35 | 35 | provides access to the various aspects of Splunk's functionality, which are |
36 | 36 | exposed via the REST API. Typically you connect to a running Splunk instance |
37 | | -with the :func:`connect` function. |
38 | | -
|
39 | | -**Example**:: |
| 37 | +with the :func:`connect` function:: |
40 | 38 |
|
41 | 39 | import splunklib.client as client |
42 | 40 | service = client.connect(host='localhost', port=8089, |
|
45 | 43 | |
46 | 44 | :class:`Service` objects have fields for the various Splunk resources (such as apps, |
47 | 45 | jobs, saved searches, inputs, and indexes). All of these fields are |
48 | | -:class:`Collection` objects. |
49 | | -
|
50 | | -**Example**:: |
| 46 | +:class:`Collection` objects:: |
51 | 47 |
|
52 | 48 | appcollection = service.apps |
53 | 49 | my_app = appcollection.create('my_app') |
|
56 | 52 |
|
57 | 53 | The individual elements of the collection, in this case *applications*, |
58 | 54 | are subclasses of :class:`Entity`. An ``Entity`` object has fields for its |
59 | | -attributes, and methods that are specific to each kind of entity. |
60 | | -
|
61 | | -**Example**:: |
| 55 | +attributes, and methods that are specific to each kind of entity. For example:: |
62 | 56 |
|
63 | 57 | print my_app['author'] # Or: print my_app.author |
64 | 58 | my_app.package() # Creates a compressed package of this application |
@@ -1403,8 +1397,7 @@ def list(self, count=None, **kwargs): |
1403 | 1397 | returned items: "auto", "alpha", "alpha_case", or "num". |
1404 | 1398 | |
1405 | 1399 | :type kwargs: ``dict`` |
1406 | | - :return: A collection of entities. |
1407 | | - :rtype: ``list`` |
| 1400 | + :return: A ``list`` of entities. |
1408 | 1401 | """ |
1409 | 1402 | # response = self.get(count=count, **kwargs) |
1410 | 1403 | # return self._load_list(response) |
@@ -1434,8 +1427,7 @@ def names(self, count=None, **kwargs): |
1434 | 1427 | returned items: "auto", "alpha", "alpha_case", or "num". |
1435 | 1428 | |
1436 | 1429 | :type kwargs: ``dict`` |
1437 | | - :return: A list of entity names. |
1438 | | - :rtype: ``list`` |
| 1430 | + :return: A ``list`` of entity names. |
1439 | 1431 | """ |
1440 | 1432 | return [ent.name for ent in self.iter(count=count, **kwargs)] |
1441 | 1433 |
|
@@ -1464,8 +1456,8 @@ class Collection(ReadOnlyCollection): |
1464 | 1456 | # Or if there is only one search visible named 'my_search' |
1465 | 1457 | mysearch = mycollection['my_search'] |
1466 | 1458 |
|
1467 | | - Similarly, ``name`` in ``mycollection`` works as you expect (though you cannot |
1468 | | - currently pass a namespace to the ``in`` operator), as does |
| 1459 | + Similarly, ``name`` in ``mycollection`` works as you might expect (though |
| 1460 | + you cannot currently pass a namespace to the ``in`` operator), as does |
1469 | 1461 | ``len(mycollection)``. |
1470 | 1462 |
|
1471 | 1463 | However, as an aggregate, :class:`Collection` behaves more like a |
@@ -1788,12 +1780,17 @@ def attached_socket(self, *args, **kwargs): |
1788 | 1780 | automatically closed at the end of the ``with`` block, even if an |
1789 | 1781 | exception is raised in the block. |
1790 | 1782 |
|
1791 | | - :param host: The host value for events written to the stream. |
1792 | | - :type host: ``string`` |
1793 | | - :param source: The source value for events written to the stream. |
1794 | | - :type source: ``string`` |
1795 | | - :param sourcetype: The sourcetype value for events written to the stream. |
1796 | | - :type sourcetype: ``string`` |
| 1783 | + :param args: Additional arguments: |
| 1784 | +
|
| 1785 | + - "host" (``string``): The host value for events written to the stream. |
| 1786 | +
|
| 1787 | + - "source" (``string``): The source value for events written to the stream. |
| 1788 | +
|
| 1789 | + - "sourcetype" (``string``): The sourcetype value for events written to the stream. |
| 1790 | +
|
| 1791 | + :type args: ``dict`` |
| 1792 | + :param kwargs: FRED? |
| 1793 | + :type kwargs: ``dict`` |
1797 | 1794 |
|
1798 | 1795 | **Example**:: |
1799 | 1796 |
|
|
0 commit comments