#!/usr/bin/python3

"""
.. module:: wazuh_api_client
   :platform: Unix, Windows, Mac
   :synopsis: Wazuh API Client
.. moduleauthor:: <NAME> <<EMAIL>>
"""

import argparse
import requests
import json

API_URL = 'http://localhost:5000/'


def query():
    """Launch query to API REST."""
    pass


def get_info(API_URL):
    """Launch info function."""
    print '\nGetting info.\n'
    try:
        res = requests.get(API_URL)
    except requests.exceptions.RequestException as e:
        print e

    print res.text


def main():
    """Main function."""
    parser = argparse.ArgumentParser(
        description='API Client for Wazuh REST API.')
    parser.add_argument(
        '-i',
        '--info',
        help='Get info.',
        action='store_true',
        required=False
    )

    args = parser.parse_args()

    print args

    if args.info:
        launch_info(API_URL)


if __name__ == '__main__':
    main()

#!/usr/bin/python3

"""
.. module:: wazuh_api_client
   :platform: Unix, Windows, Mac
   :synopsis: Wazuh API Client
.. moduleauthor:: <NAME> <<EMAIL>>
"""

import argparse
import requests
import json

API_URL = 'http://localhost:5000/'


def query():
    """Launch query to API REST."""
    pass


def get_info(API_URL):
    """Launch info function."""
    print '\nGetting info.\n'
    try:
        res = requests.get(API_URL)
    except requests.exceptions.RequestException as e:
        print e

    print res.text


def main():
    """Main function."""
    parser = argparse.ArgumentParser(
        description='API Client for Wazuh REST API.')
    parser.add_argument(
        '-i',
        '--info',
        help='Get info.',
        action='store_true',
        required=False
    )

    args = parser.parse_args()

    print args

    if args.info:
        launch_info(API_URL)


if __name__ == '__main__':
    main()

#!/usr/bin/python3 .. module:: wazuh_api_client    :platform: Unix, Windows, Mac    :synopsis: Wazuh API Client .. moduleauthor:: <NAME> <<EMAIL>> Launch query to API REST. Launch info function. Main function.