|
11 | 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
12 | 12 | # License for the specific language governing permissions and limitations |
13 | 13 | # under the License. |
14 | | -# |
15 | | -# The purpose of this module is to provide a friendlier domain interface to |
16 | | -# various Splunk endpoints. The approach here is to leverage the binding |
17 | | -# layer to capture endpoint context and provide objects and methods that |
18 | | -# offer simplified access their corresponding endpoints. The design avoids |
19 | | -# caching resource state. From the perspective of this module, the 'policy' |
20 | | -# for caching resource state belongs in the application or a higher level |
21 | | -# framework, and its the purpose of this module to provide simplified |
22 | | -# access to that resource state. |
23 | | -# |
24 | | -# A side note, the objects below that provide helper methods for updating eg: |
25 | | -# Entity state, are written so that they may be used in a fluent style. |
26 | | -# |
27 | 14 |
|
28 | 15 | """The **splunklib.client** module provides a Pythonic interface to the |
29 | 16 | `Splunk REST API <http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTcontents>`_, |
|
56 | 43 |
|
57 | 44 | print(my_app['author']) # Or: print(my_app.author) |
58 | 45 | my_app.package() # Creates a compressed package of this application |
| 46 | +
|
| 47 | +The purpose of this module is to provide a friendlier domain interface to |
| 48 | +various Splunk endpoints. The approach here is to leverage the binding |
| 49 | +layer to capture endpoint context and provide objects and methods that |
| 50 | +offer simplified access their corresponding endpoints. The design avoids |
| 51 | +caching resource state. From the perspective of this module, the 'policy' |
| 52 | +for caching resource state belongs in the application or a higher level |
| 53 | +framework, and its the purpose of this module to provide simplified |
| 54 | +access to that resource state. |
| 55 | +
|
| 56 | +A side note, the objects below that provide helper methods for updating eg: |
| 57 | +Entity state, are written so that they may be used in a fluent style. |
59 | 58 | """ |
60 | 59 |
|
61 | 60 | import contextlib |
62 | | -import datetime |
63 | 61 | import json |
64 | 62 | import logging |
65 | 63 | import re |
|
68 | 66 | from time import sleep |
69 | 67 | from urllib import parse |
70 | 68 |
|
| 69 | +from deprecated import deprecated |
| 70 | + |
71 | 71 | from . import data |
72 | | -from .data import record |
73 | 72 | from .binding import ( |
74 | 73 | AuthenticationError, |
75 | 74 | Context, |
|
80 | 79 | _NoAuthenticationToken, |
81 | 80 | namespace, |
82 | 81 | ) |
| 82 | +from .data import record |
83 | 83 |
|
84 | 84 | logger = logging.getLogger(__name__) |
85 | 85 |
|
86 | 86 | __all__ = [ |
87 | | - "connect", |
| 87 | + "AuthenticationError", |
| 88 | + "IncomparableException", |
88 | 89 | "NotSupportedError", |
89 | 90 | "OperationError", |
90 | | - "IncomparableException", |
91 | 91 | "Service", |
| 92 | + "connect", |
92 | 93 | "namespace", |
93 | | - "AuthenticationError", |
94 | 94 | ] |
95 | 95 |
|
96 | 96 | PATH_APPS = "apps/local/" |
@@ -2007,6 +2007,10 @@ def clear_password(self): |
2007 | 2007 | return self.content.get("clear_password") |
2008 | 2008 |
|
2009 | 2009 | @property |
| 2010 | + @deprecated( |
| 2011 | + version="2.2.0", |
| 2012 | + reason="To improve security, this field now returns an empty string and will be removed from Splunk in a future release.", |
| 2013 | + ) |
2010 | 2014 | def encrypted_password(self): |
2011 | 2015 | return self.content.get("encr_password") |
2012 | 2016 |
|
|
0 commit comments