Skip to content
Snippets Groups Projects
Unverified Commit abf591f7 authored by Martin Weise's avatar Martin Weise
Browse files

Removed untracked files

parent f1497bee
No related branches found
No related tags found
No related merge requests found
Pipeline #2395 failed
Showing
with 29 additions and 1795 deletions
...@@ -5,6 +5,17 @@ node_modules/ ...@@ -5,6 +5,17 @@ node_modules/
*.bkp *.bkp
swagger/**/docs/*.md swagger/**/docs/*.md
# API
./swagger/api-analyse/
./swagger/api-container/
./swagger/api-database/
./swagger/api-document/
./swagger/api-identifier/
./swagger/api-metadata/
./swagger/api-query/
./swagger/api-table/
./swagger/api-units/
# Keys # Keys
id_rsa id_rsa
......
...@@ -19,9 +19,22 @@ build-mkdocs: ...@@ -19,9 +19,22 @@ build-mkdocs:
script: script:
- make build - make build
deploy-mkdocs: deploy-docs:
stage: deploy stage: deploy
needs: needs:
- build-mkdocs - build-mkdocs
only:
refs:
- master
script: script:
- make deploy - make deploy
deploy-dockerhub-docs:
stage: deploy
needs:
- build-mkdocs
only:
refs:
- master
script:
- make docs
USERNAME=... DOCKER_USERNAME=...
PASSWORD=... DOCKER_PASSWORD=...
\ No newline at end of file \ No newline at end of file
import requests as rq import requests as rq
import os import os
from py_dotenv import read_dotenv
class Dockerhub: class Dockerhub:
"""A simple Dockerhub client""" """A simple Dockerhub client"""
...@@ -14,11 +13,10 @@ class Dockerhub: ...@@ -14,11 +13,10 @@ class Dockerhub:
} }
def __init__(self): def __init__(self):
read_dotenv(self.workpath + "/.env") self.username = os.getenv("DOCKER_USERNAME")
self.username = os.getenv("USERNAME")
response = rq.post(self.baseurl + "/v2/users/login", { response = rq.post(self.baseurl + "/v2/users/login", {
"username": self.username, "username": self.username,
"password": os.getenv("PASSWORD") "password": os.getenv("DOCKER_PASSWORD")
}) })
if response.status_code == 200: if response.status_code == 200:
self.headers["Authorization"] = "Bearer " + response.json()["token"] self.headers["Authorization"] = "Bearer " + response.json()["token"]
......
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# 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/
venv/
.python-version
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Ipython Notebook
.ipynb_checkpoints
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
3.0.34
\ No newline at end of file
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.2"
- "3.3"
- "3.4"
- "3.5"
#- "3.5-dev" # 3.5 development branch
#- "nightly" # points to the latest development branch e.g. 3.6-dev
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: nosetests
# swagger-client
Service that manages the analysis
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
- API version: 1.1.0-alpha
- Package version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
## Requirements.
Python 2.7 and 3.4+
## Installation & Usage
### pip install
If the python package is hosted on Github, you can install directly from Github
```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
Then import the package:
```python
import swagger_client
```
### Setuptools
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)
Then import the package:
```python
import swagger_client
```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.AnalyseEndpointApi(swagger_client.ApiClient(configuration))
body = swagger_client.DetermineDataTypeRequestDto() # DetermineDataTypeRequestDto |
try:
# Determine datatypes
api_response = api_instance.api_analyse_determinedt_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AnalyseEndpointApi->api_analyse_determinedt_post: %s\n" % e)
# create an instance of the API class
api_instance = swagger_client.AnalyseEndpointApi(swagger_client.ApiClient(configuration))
body = swagger_client.AnalyseDeterminepkBody() # AnalyseDeterminepkBody |
try:
# Determine primary keys
api_response = api_instance.api_analyse_determinepk_post(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling AnalyseEndpointApi->api_analyse_determinepk_post: %s\n" % e)
```
## Documentation for API Endpoints
All URIs are relative to *https://virtserver.swaggerhub.com/mweise/dbrepo-debug/1.1.0-alpha*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnalyseEndpointApi* | [**api_analyse_determinedt_post**](docs/AnalyseEndpointApi.md#api_analyse_determinedt_post) | **POST** /api/analyse/determinedt | Determine datatypes
*AnalyseEndpointApi* | [**api_analyse_determinepk_post**](docs/AnalyseEndpointApi.md#api_analyse_determinepk_post) | **POST** /api/analyse/determinepk | Determine primary keys
*MdbEndpointApi* | [**api_analyse_update_mdb_col_post**](docs/MdbEndpointApi.md#api_analyse_update_mdb_col_post) | **POST** /api/analyse/update_mdb_col | Update entity mdb_columns from metadatabase
## Documentation For Models
- [AnalyseDeterminepkBody](docs/AnalyseDeterminepkBody.md)
- [DataTypeDto](docs/DataTypeDto.md)
- [DetermineDataTypeRequestDto](docs/DetermineDataTypeRequestDto.md)
- [DetermineDataTypeResponseDto](docs/DetermineDataTypeResponseDto.md)
- [DeterminePrimaryKeyDto](docs/DeterminePrimaryKeyDto.md)
- [ErrorDto](docs/ErrorDto.md)
- [UpdateColumnDto](docs/UpdateColumnDto.md)
## Documentation For Authorization
All endpoints do not require authorization.
## Author
andreas.rauber@tuwien.ac.at
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
git_user_id=$1
git_repo_id=$2
release_note=$3
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
certifi >= 14.05.14
six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
# coding: utf-8
"""
Database Repository Analyse Service API
Service that manages the analysis # noqa: E501
OpenAPI spec version: 1.1.0-alpha
Contact: andreas.rauber@tuwien.ac.at
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from setuptools import setup, find_packages # noqa: H301
NAME = "swagger-client"
VERSION = "1.0.0"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
setup(
name=NAME,
version=VERSION,
description="Database Repository Analyse Service API",
author_email="andreas.rauber@tuwien.ac.at",
url="",
keywords=["Swagger", "Database Repository Analyse Service API"],
install_requires=REQUIRES,
packages=find_packages(),
include_package_data=True,
long_description="""\
Service that manages the analysis # noqa: E501
"""
)
# coding: utf-8
# flake8: noqa
"""
Database Repository Analyse Service API
Service that manages the analysis # noqa: E501
OpenAPI spec version: 1.1.0-alpha
Contact: andreas.rauber@tuwien.ac.at
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
# import apis into sdk package
from swagger_client.api.analyse_endpoint_api import AnalyseEndpointApi
from swagger_client.api.mdb_endpoint_api import MdbEndpointApi
# import ApiClient
from swagger_client.api_client import ApiClient
from swagger_client.configuration import Configuration
# import models into sdk package
from swagger_client.models.analyse_determinepk_body import AnalyseDeterminepkBody
from swagger_client.models.data_type_dto import DataTypeDto
from swagger_client.models.determine_data_type_request_dto import DetermineDataTypeRequestDto
from swagger_client.models.determine_data_type_response_dto import DetermineDataTypeResponseDto
from swagger_client.models.determine_primary_key_dto import DeterminePrimaryKeyDto
from swagger_client.models.error_dto import ErrorDto
from swagger_client.models.update_column_dto import UpdateColumnDto
from __future__ import absolute_import
# flake8: noqa
# import apis into api package
from swagger_client.api.analyse_endpoint_api import AnalyseEndpointApi
from swagger_client.api.mdb_endpoint_api import MdbEndpointApi
# coding: utf-8
"""
Database Repository Analyse Service API
Service that manages the analysis # noqa: E501
OpenAPI spec version: 1.1.0-alpha
Contact: andreas.rauber@tuwien.ac.at
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from swagger_client.api_client import ApiClient
class AnalyseEndpointApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def api_analyse_determinedt_post(self, body, **kwargs): # noqa: E501
"""Determine datatypes # noqa: E501
This is a simple API which returns the datatypes of a (path) csv file # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.api_analyse_determinedt_post(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param DetermineDataTypeRequestDto body: (required)
:return: DetermineDataTypeResponseDto
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.api_analyse_determinedt_post_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.api_analyse_determinedt_post_with_http_info(body, **kwargs) # noqa: E501
return data
def api_analyse_determinedt_post_with_http_info(self, body, **kwargs): # noqa: E501
"""Determine datatypes # noqa: E501
This is a simple API which returns the datatypes of a (path) csv file # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.api_analyse_determinedt_post_with_http_info(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param DetermineDataTypeRequestDto body: (required)
:return: DetermineDataTypeResponseDto
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method api_analyse_determinedt_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `api_analyse_determinedt_post`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/analyse/determinedt', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DetermineDataTypeResponseDto', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def api_analyse_determinepk_post(self, body, **kwargs): # noqa: E501
"""Determine primary keys # noqa: E501
This is a simple API which returns the primary keys + ranking of a (path) csv file # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.api_analyse_determinepk_post(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param AnalyseDeterminepkBody body: (required)
:return: DeterminePrimaryKeyDto
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.api_analyse_determinepk_post_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.api_analyse_determinepk_post_with_http_info(body, **kwargs) # noqa: E501
return data
def api_analyse_determinepk_post_with_http_info(self, body, **kwargs): # noqa: E501
"""Determine primary keys # noqa: E501
This is a simple API which returns the primary keys + ranking of a (path) csv file # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.api_analyse_determinepk_post_with_http_info(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param AnalyseDeterminepkBody body: (required)
:return: DeterminePrimaryKeyDto
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method api_analyse_determinepk_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `api_analyse_determinepk_post`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/json']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/analyse/determinepk', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='DeterminePrimaryKeyDto', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
# coding: utf-8
"""
Database Repository Analyse Service API
Service that manages the analysis # noqa: E501
OpenAPI spec version: 1.1.0-alpha
Contact: andreas.rauber@tuwien.ac.at
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import six
from swagger_client.api_client import ApiClient
class MdbEndpointApi(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
Ref: https://github.com/swagger-api/swagger-codegen
"""
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def api_analyse_update_mdb_col_post(self, body, **kwargs): # noqa: E501
"""Update entity mdb_columns from metadatabase # noqa: E501
Updates entity mdb_columns and mdb_columns_num, mdb_columns_nom and mdb_columns_cat in metadatabase # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.api_analyse_update_mdb_col_post(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param UpdateColumnDto body: Updates entity mdb_columns attributes (datatype, ordinal_position, is_nullable) and automatically updates mdb_columns_nom (attribute max_length), mdb_columns_num (min, max, mean, sd, histogram) and mdb_columns_cat (num_cat, cat_array). The attribute 'histogram' describes a equi-width histogram with a fix number of 10 buckets. The last value in this numeric array is the width of one bucket. The attribute cat_array contains an array with the names of the categories. (required)
:return: UpdateColumnDto
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.api_analyse_update_mdb_col_post_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.api_analyse_update_mdb_col_post_with_http_info(body, **kwargs) # noqa: E501
return data
def api_analyse_update_mdb_col_post_with_http_info(self, body, **kwargs): # noqa: E501
"""Update entity mdb_columns from metadatabase # noqa: E501
Updates entity mdb_columns and mdb_columns_num, mdb_columns_nom and mdb_columns_cat in metadatabase # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.api_analyse_update_mdb_col_post_with_http_info(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param UpdateColumnDto body: Updates entity mdb_columns attributes (datatype, ordinal_position, is_nullable) and automatically updates mdb_columns_nom (attribute max_length), mdb_columns_num (min, max, mean, sd, histogram) and mdb_columns_cat (num_cat, cat_array). The attribute 'histogram' describes a equi-width histogram with a fix number of 10 buckets. The last value in this numeric array is the width of one bucket. The attribute cat_array contains an array with the names of the categories. (required)
:return: UpdateColumnDto
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method api_analyse_update_mdb_col_post" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'body' is set
if ('body' not in params or
params['body'] is None):
raise ValueError("Missing the required parameter `body` when calling `api_analyse_update_mdb_col_post`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['*/*']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['*/*']) # noqa: E501
# Authentication setting
auth_settings = [] # noqa: E501
return self.api_client.call_api(
'/api/analyse/update_mdb_col', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='UpdateColumnDto', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
This diff is collapsed.
# coding: utf-8
"""
Database Repository Analyse Service API
Service that manages the analysis # noqa: E501
OpenAPI spec version: 1.1.0-alpha
Contact: andreas.rauber@tuwien.ac.at
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import copy
import logging
import multiprocessing
import sys
import urllib3
import six
from six.moves import http_client as httplib
class TypeWithDefault(type):
def __init__(cls, name, bases, dct):
super(TypeWithDefault, cls).__init__(name, bases, dct)
cls._default = None
def __call__(cls):
if cls._default is None:
cls._default = type.__call__(cls)
return copy.copy(cls._default)
def set_default(cls, default):
cls._default = copy.copy(default)
class Configuration(six.with_metaclass(TypeWithDefault, object)):
"""NOTE: This class is auto generated by the swagger code generator program.
Ref: https://github.com/swagger-api/swagger-codegen
Do not edit the class manually.
"""
def __init__(self):
"""Constructor"""
# Default Base url
self.host = "https://virtserver.swaggerhub.com/mweise/dbrepo-debug/1.1.0-alpha"
# Temp file folder for downloading files
self.temp_folder_path = None
# Authentication Settings
# dict to store API key(s)
self.api_key = {}
# dict to store API prefix (e.g. Bearer)
self.api_key_prefix = {}
# function to refresh API key if expired
self.refresh_api_key_hook = None
# Username for HTTP basic authentication
self.username = ""
# Password for HTTP basic authentication
self.password = ""
# Logging Settings
self.logger = {}
self.logger["package_logger"] = logging.getLogger("swagger_client")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
# Log format
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
# Log stream handler
self.logger_stream_handler = None
# Log file handler
self.logger_file_handler = None
# Debug file location
self.logger_file = None
# Debug switch
self.debug = False
# SSL/TLS verification
# Set this to false to skip verifying SSL certificate when calling API
# from https server.
self.verify_ssl = True
# Set this to customize the certificate file to verify the peer.
self.ssl_ca_cert = None
# client certificate file
self.cert_file = None
# client key file
self.key_file = None
# Set this to True/False to enable/disable SSL hostname verification.
self.assert_hostname = None
# urllib3 connection pool's maximum number of connections saved
# per pool. urllib3 uses 1 connection as default value, but this is
# not the best value when you are making a lot of possibly parallel
# requests to the same host, which is often the case here.
# cpu_count * 5 is used as default value to increase performance.
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
# Proxy URL
self.proxy = None
# Safe chars for path_param
self.safe_chars_for_path_param = ''
@property
def logger_file(self):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
def logger_file(self, value):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_file_handler)
if self.logger_stream_handler:
logger.removeHandler(self.logger_stream_handler)
else:
# If not set logging file,
# then add stream handler and remove file handler.
self.logger_stream_handler = logging.StreamHandler()
self.logger_stream_handler.setFormatter(self.logger_formatter)
for _, logger in six.iteritems(self.logger):
logger.addHandler(self.logger_stream_handler)
if self.logger_file_handler:
logger.removeHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in six.iteritems(self.logger):
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
return self.__logger_format
@logger_format.setter
def logger_format(self, value):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:return: The token for api key authentication.
"""
if self.refresh_api_key_hook:
self.refresh_api_key_hook(self)
key = self.api_key.get(identifier)
if key:
prefix = self.api_key_prefix.get(identifier)
if prefix:
return "%s %s" % (prefix, key)
else:
return key
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
return {
}
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 1.1.0-alpha\n"\
"SDK Package Version: 1.0.0".\
format(env=sys.platform, pyversion=sys.version)
# coding: utf-8
# flake8: noqa
"""
Database Repository Analyse Service API
Service that manages the analysis # noqa: E501
OpenAPI spec version: 1.1.0-alpha
Contact: andreas.rauber@tuwien.ac.at
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
# import models into model package
from swagger_client.models.analyse_determinepk_body import AnalyseDeterminepkBody
from swagger_client.models.data_type_dto import DataTypeDto
from swagger_client.models.determine_data_type_request_dto import DetermineDataTypeRequestDto
from swagger_client.models.determine_data_type_response_dto import DetermineDataTypeResponseDto
from swagger_client.models.determine_primary_key_dto import DeterminePrimaryKeyDto
from swagger_client.models.error_dto import ErrorDto
from swagger_client.models.update_column_dto import UpdateColumnDto
# coding: utf-8
"""
Database Repository Analyse Service API
Service that manages the analysis # noqa: E501
OpenAPI spec version: 1.1.0-alpha
Contact: andreas.rauber@tuwien.ac.at
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class AnalyseDeterminedtBody(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'filepath': 'str',
'enum': 'bool',
'enum_tol': 'object',
'separator': 'str'
}
attribute_map = {
'filepath': 'filepath',
'enum': 'enum',
'enum_tol': 'enum_tol',
'separator': 'separator'
}
def __init__(self, filepath=None, enum=None, enum_tol=None, separator=None): # noqa: E501
"""AnalyseDeterminedtBody - a model defined in Swagger""" # noqa: E501
self._filepath = None
self._enum = None
self._enum_tol = None
self._separator = None
self.discriminator = None
if filepath is not None:
self.filepath = filepath
if enum is not None:
self.enum = enum
if enum_tol is not None:
self.enum_tol = enum_tol
if separator is not None:
self.separator = separator
@property
def filepath(self):
"""Gets the filepath of this AnalyseDeterminedtBody. # noqa: E501
:return: The filepath of this AnalyseDeterminedtBody. # noqa: E501
:rtype: str
"""
return self._filepath
@filepath.setter
def filepath(self, filepath):
"""Sets the filepath of this AnalyseDeterminedtBody.
:param filepath: The filepath of this AnalyseDeterminedtBody. # noqa: E501
:type: str
"""
self._filepath = filepath
@property
def enum(self):
"""Gets the enum of this AnalyseDeterminedtBody. # noqa: E501
:return: The enum of this AnalyseDeterminedtBody. # noqa: E501
:rtype: bool
"""
return self._enum
@enum.setter
def enum(self, enum):
"""Sets the enum of this AnalyseDeterminedtBody.
:param enum: The enum of this AnalyseDeterminedtBody. # noqa: E501
:type: bool
"""
self._enum = enum
@property
def enum_tol(self):
"""Gets the enum_tol of this AnalyseDeterminedtBody. # noqa: E501
:return: The enum_tol of this AnalyseDeterminedtBody. # noqa: E501
:rtype: object
"""
return self._enum_tol
@enum_tol.setter
def enum_tol(self, enum_tol):
"""Sets the enum_tol of this AnalyseDeterminedtBody.
:param enum_tol: The enum_tol of this AnalyseDeterminedtBody. # noqa: E501
:type: object
"""
self._enum_tol = enum_tol
@property
def separator(self):
"""Gets the separator of this AnalyseDeterminedtBody. # noqa: E501
:return: The separator of this AnalyseDeterminedtBody. # noqa: E501
:rtype: str
"""
return self._separator
@separator.setter
def separator(self, separator):
"""Sets the separator of this AnalyseDeterminedtBody.
:param separator: The separator of this AnalyseDeterminedtBody. # noqa: E501
:type: str
"""
self._separator = separator
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(AnalyseDeterminedtBody, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, AnalyseDeterminedtBody):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment