Skip to content
This repository was archived by the owner on Dec 3, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# editor
*.sw?
2 changes: 0 additions & 2 deletions api-tools/requirements.txt

This file was deleted.

45 changes: 40 additions & 5 deletions api-tools/setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
#!/usr/bin/env python
'Install trident_client module'

from distutils.core import setup
from os import path
from codecs import open
from setuptools import setup

setup(name='trident_client',
version='1.0',

here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

setup(
name='trident_client',
version='1.2',
description='JASK Trident API Client',
long_description=long_description,
url='https://github.com/jasklabs/jask-api',
author='JASK Labs',
author_email='support@jask.io',
url='https://jask.io',
license='',
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
#'Development Status :: 1 - Planning',
#'Development Status :: 2 - Pre-Alpha',
#'Development Status :: 3 - Alpha',
'Development Status :: 4 - Beta',
#'Development Status :: 5 - Production/Stable',
#'Development Status :: 6 - Mature',
#'Development Status :: 7 - Inactive',
'Environment :: Console',
'Intended Audience :: Information Technology',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX',
'Programming Language :: Python :: 3',
'Topic :: Security',
],
packages=['trident_client'],
include_package_data=True,
zip_safe=False,
install_requires=[
'requests==2.20.0',
'unicodecsv==0.14.1',
],
)
6 changes: 3 additions & 3 deletions api-tools/trident_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from asset_api import get_asset_detail, update_metadata, delete_metadata
from search_api import SEARCH_ALL, SEARCH_ASSETS, SEARCH_ALERTS, SEARCH_SIGNALS, search, get_details
from status_api import list_sensors, list_users
from .asset_api import get_asset_detail, update_metadata, delete_metadata
from .search_api import SEARCH_ALL, SEARCH_ASSETS, SEARCH_ALERTS, SEARCH_SIGNALS, search, get_details
from .status_api import list_sensors, list_users
2 changes: 1 addition & 1 deletion api-tools/trident_client/asset_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging, requests
from utils import validate_basic_params
from .utils import validate_basic_params

log = logging.getLogger()

Expand Down
5 changes: 4 additions & 1 deletion api-tools/trident_client/configuration_api.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from utils import validate_basic_params
import logging

import requests
import unicodecsv as csv

from .utils import validate_basic_params


log = logging.getLogger()

def _submit_network_blocks(cluster, username, api_key, batch):
Expand Down
6 changes: 4 additions & 2 deletions api-tools/trident_client/intel_api.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import logging
import sys
import logging

import requests
import unicodecsv as csv

from utils import validate_basic_params, is_int_string
from .utils import validate_basic_params, is_int_string


log = logging.getLogger()

Expand Down
8 changes: 6 additions & 2 deletions api-tools/trident_client/search_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import logging, requests
from utils import validate_basic_params
import logging

import requests

from .utils import validate_basic_params


log = logging.getLogger()

Expand Down
4 changes: 2 additions & 2 deletions api-tools/trident_client/status_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from utils import get_simple_list, validate_basic_params
from .utils import get_simple_list, validate_basic_params

"""
Get a list of the sensors associated with this cluster.
Expand All @@ -22,4 +22,4 @@ def list_sensors(cluster_name, username, api_key):
def list_users(cluster_name, username, api_key):
validate_basic_params(cluster_name, username, api_key)
url = 'https://%s/api/user' % cluster_name
return get_simple_list(url, username, api_key)
return get_simple_list(url, username, api_key)