# Path: splunklib/client.py
# def connect(**kwargs):
#     """This function connects and logs in to a Splunk instance.
# 
#     This function is a shorthand for :meth:`Service.login`.
#     The ``connect`` function makes one round trip to the server (for logging in).
# 
#     :param host: The host name (the default is "localhost").
#     :type host: ``string``
#     :param port: The port number (the default is 8089).
#     :type port: ``integer``
#     :param scheme: The scheme for accessing the service (the default is "https").
#     :type scheme: "https" or "http"
#     :param verify: Enable (True) or disable (False) SSL verification for
#                    https connections. (optional, the default is True)
#     :type verify: ``Boolean``
#     :param `owner`: The owner context of the namespace (optional).
#     :type owner: ``string``
#     :param `app`: The app context of the namespace (optional).
#     :type app: ``string``
#     :param sharing: The sharing mode for the namespace (the default is "user").
#     :type sharing: "global", "system", "app", or "user"
#     :param `token`: The current session token (optional). Session tokens can be
#                     shared across multiple service instances.
#     :type token: ``string``
#     :param cookie: A session cookie. When provided, you don't need to call :meth:`login`.
#         This parameter is only supported for Splunk 6.2+.
#     :type cookie: ``string``
#     :param autologin: When ``True``, automatically tries to log in again if the
#         session terminates.
#     :type autologin: ``boolean``
#     :param `username`: The Splunk account username, which is used to
#                        authenticate the Splunk instance.
#     :type username: ``string``
#     :param `password`: The password for the Splunk account.
#     :type password: ``string``
#     :param `context`: The SSLContext that can be used when setting verify=True (optional)
#     :type context: ``SSLContext``
#     :return: An initialized :class:`Service` connection.
# 
#     **Example**::
# 
#         import splunklib.client as client
#         s = client.connect(...)
#         a = s.apps["my_app"]
#         ...
#     """
#     s = Service(**kwargs)
#     s.login()
#     return s


import sys, os
from splunklib.client import connect
    from utils import parse
#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

"""A command line utility that lists Splunk event types."""

from __future__ import absolute_import
from __future__ import print_function
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))


try:
except ImportError:
    raise Exception("Add the SDK repository to your PYTHONPATH to run the examples "
                    "(e.g., export PYTHONPATH=~/splunk-sdk-python.")

def main():
    opts = parse(sys.argv[1:], {}, ".splunkrc")

# Path: splunklib/client.py
# def connect(**kwargs):
#     """This function connects and logs in to a Splunk instance.
# 
#     This function is a shorthand for :meth:`Service.login`.
#     The ``connect`` function makes one round trip to the server (for logging in).
# 
#     :param host: The host name (the default is "localhost").
#     :type host: ``string``
#     :param port: The port number (the default is 8089).
#     :type port: ``integer``
#     :param scheme: The scheme for accessing the service (the default is "https").
#     :type scheme: "https" or "http"
#     :param verify: Enable (True) or disable (False) SSL verification for
#                    https connections. (optional, the default is True)
#     :type verify: ``Boolean``
#     :param `owner`: The owner context of the namespace (optional).
#     :type owner: ``string``
#     :param `app`: The app context of the namespace (optional).
#     :type app: ``string``
#     :param sharing: The sharing mode for the namespace (the default is "user").
#     :type sharing: "global", "system", "app", or "user"
#     :param `token`: The current session token (optional). Session tokens can be
#                     shared across multiple service instances.
#     :type token: ``string``
#     :param cookie: A session cookie. When provided, you don't need to call :meth:`login`.
#         This parameter is only supported for Splunk 6.2+.
#     :type cookie: ``string``
#     :param autologin: When ``True``, automatically tries to log in again if the
#         session terminates.
#     :type autologin: ``boolean``
#     :param `username`: The Splunk account username, which is used to
#                        authenticate the Splunk instance.
#     :type username: ``string``
#     :param `password`: The password for the Splunk account.
#     :type password: ``string``
#     :param `context`: The SSLContext that can be used when setting verify=True (optional)
#     :type context: ``SSLContext``
#     :return: An initialized :class:`Service` connection.
# 
#     **Example**::
# 
#         import splunklib.client as client
#         s = client.connect(...)
#         a = s.apps["my_app"]
#         ...
#     """
#     s = Service(**kwargs)
#     s.login()
#     return s


# Path: examples/event_types.py
import sys, os
from splunklib.client import connect
    from utils import parse

#!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

"""A command line utility that lists Splunk event types."""

from __future__ import absolute_import
from __future__ import print_function
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))


try:
except ImportError:
    raise Exception("Add the SDK repository to your PYTHONPATH to run the examples "
                    "(e.g., export PYTHONPATH=~/splunk-sdk-python.")

def main():
    opts = parse(sys.argv[1:], {}, ".splunkrc")

    service = connect(**opts.kwargs)