cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
cFSPlib.python_api_client.swagger_client.configuration.Configuration Class Reference
Inheritance diagram for cFSPlib.python_api_client.swagger_client.configuration.Configuration:
[legend]
Collaboration diagram for cFSPlib.python_api_client.swagger_client.configuration.Configuration:
[legend]

Public Member Functions

def __init__ (self)
 
def logger_file (self)
 
def logger_file (self, value)
 
def debug (self)
 
def debug (self, value)
 
def logger_format (self)
 
def logger_format (self, value)
 
def get_api_key_with_prefix (self, identifier)
 
def get_basic_auth_token (self)
 
def auth_settings (self)
 
def to_debug_report (self)
 
- Public Member Functions inherited from cFSPlib.python_api_client.swagger_client.configuration.TypeWithDefault
def __init__ (cls, name, bases, dct)
 
def __call__ (cls)
 
def set_default (cls, default)
 

Public Attributes

 host
 
 temp_folder_path
 
 api_key
 
 api_key_prefix
 
 refresh_api_key_hook
 
 username
 
 password
 
 logger
 
 logger_format
 
 logger_stream_handler
 
 logger_file_handler
 
 logger_file
 
 debug
 
 verify_ssl
 
 ssl_ca_cert
 
 cert_file
 
 key_file
 
 assert_hostname
 
 connection_pool_maxsize
 
 proxy
 
 safe_chars_for_path_param
 
 logger_formatter
 

Detailed Description

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.

Definition at line 39 of file configuration.py.

Constructor & Destructor Documentation

◆ __init__()

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.__init__ (   self)
Constructor

Definition at line 46 of file configuration.py.

46  def __init__(self):
47  """Constructor"""
48  # Default Base url
49  self.host = "/"
50  # Temp file folder for downloading files
51  self.temp_folder_path = None
52 
53  # Authentication Settings
54  # dict to store API key(s)
55  self.api_key = {}
56  # dict to store API prefix (e.g. Bearer)
57  self.api_key_prefix = {}
58  # function to refresh API key if expired
59  self.refresh_api_key_hook = None
60  # Username for HTTP basic authentication
61  self.username = ""
62  # Password for HTTP basic authentication
63  self.password = ""
64  # Logging Settings
65  self.logger = {}
66  self.logger["package_logger"] = logging.getLogger("swagger_client")
67  self.logger["urllib3_logger"] = logging.getLogger("urllib3")
68  # Log format
69  self.logger_format = '%(asctime)s %(levelname)s %(message)s'
70  # Log stream handler
71  self.logger_stream_handler = None
72  # Log file handler
73  self.logger_file_handler = None
74  # Debug file location
75  self.logger_file = None
76  # Debug switch
77  self.debug = False
78 
79  # SSL/TLS verification
80  # Set this to false to skip verifying SSL certificate when calling API
81  # from https server.
82  self.verify_ssl = True
83  # Set this to customize the certificate file to verify the peer.
84  self.ssl_ca_cert = None
85  # client certificate file
86  self.cert_file = None
87  # client key file
88  self.key_file = None
89  # Set this to True/False to enable/disable SSL hostname verification.
90  self.assert_hostname = None
91 
92  # urllib3 connection pool's maximum number of connections saved
93  # per pool. urllib3 uses 1 connection as default value, but this is
94  # not the best value when you are making a lot of possibly parallel
95  # requests to the same host, which is often the case here.
96  # cpu_count * 5 is used as default value to increase performance.
97  self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
98 
99  # Proxy URL
100  self.proxy = None
101  # Safe chars for path_param
102  self.safe_chars_for_path_param = ''
103 

Member Function Documentation

◆ auth_settings()

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.auth_settings (   self)
Gets Auth Settings dict for api client.

:return: The Auth Settings information dict.

Definition at line 226 of file configuration.py.

226  def auth_settings(self):
227  """Gets Auth Settings dict for api client.
228 
229  :return: The Auth Settings information dict.
230  """
231  return {
232  }
233 

◆ debug() [1/2]

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.debug (   self)
Debug status

:param value: The debug status, True or False.
:type: bool

Definition at line 147 of file configuration.py.

147  def debug(self):
148  """Debug status
149 
150  :param value: The debug status, True or False.
151  :type: bool
152  """
153  return self.__debug
154 

◆ debug() [2/2]

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.debug (   self,
  value 
)
Debug status

:param value: The debug status, True or False.
:type: bool

Definition at line 156 of file configuration.py.

156  def debug(self, value):
157  """Debug status
158 
159  :param value: The debug status, True or False.
160  :type: bool
161  """
162  self.__debug = value
163  if self.__debug:
164  # if debug status is True, turn on debug logging
165  for _, logger in six.iteritems(self.logger):
166  logger.setLevel(logging.DEBUG)
167  # turn on httplib debug
168  httplib.HTTPConnection.debuglevel = 1
169  else:
170  # if debug status is False, turn off debug logging,
171  # setting log level to default `logging.WARNING`
172  for _, logger in six.iteritems(self.logger):
173  logger.setLevel(logging.WARNING)
174  # turn off httplib debug
175  httplib.HTTPConnection.debuglevel = 0
176 

◆ get_api_key_with_prefix()

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.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.

Definition at line 200 of file configuration.py.

200  def get_api_key_with_prefix(self, identifier):
201  """Gets API key (with prefix if set).
202 
203  :param identifier: The identifier of apiKey.
204  :return: The token for api key authentication.
205  """
206  if self.refresh_api_key_hook:
207  self.refresh_api_key_hook(self)
208 
209  key = self.api_key.get(identifier)
210  if key:
211  prefix = self.api_key_prefix.get(identifier)
212  if prefix:
213  return "%s %s" % (prefix, key)
214  else:
215  return key
216 

◆ get_basic_auth_token()

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.get_basic_auth_token (   self)
Gets HTTP basic authentication header (string).

:return: The token for basic HTTP authentication.

Definition at line 217 of file configuration.py.

217  def get_basic_auth_token(self):
218  """Gets HTTP basic authentication header (string).
219 
220  :return: The token for basic HTTP authentication.
221  """
222  return urllib3.util.make_headers(
223  basic_auth=self.username + ':' + self.password
224  ).get('authorization')
225 

◆ logger_file() [1/2]

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.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

Definition at line 105 of file configuration.py.

105  def logger_file(self):
106  """The logger file.
107 
108  If the logger_file is None, then add stream handler and remove file
109  handler. Otherwise, add file handler and remove stream handler.
110 
111  :param value: The logger_file path.
112  :type: str
113  """
114  return self.__logger_file
115 

◆ logger_file() [2/2]

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.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

Definition at line 117 of file configuration.py.

117  def logger_file(self, value):
118  """The logger file.
119 
120  If the logger_file is None, then add stream handler and remove file
121  handler. Otherwise, add file handler and remove stream handler.
122 
123  :param value: The logger_file path.
124  :type: str
125  """
126  self.__logger_file = value
127  if self.__logger_file:
128  # If set logging file,
129  # then add file handler and remove stream handler.
130  self.logger_file_handler = logging.FileHandler(self.__logger_file)
131  self.logger_file_handler.setFormatter(self.logger_formatter)
132  for _, logger in six.iteritems(self.logger):
133  logger.addHandler(self.logger_file_handler)
134  if self.logger_stream_handler:
135  logger.removeHandler(self.logger_stream_handler)
136  else:
137  # If not set logging file,
138  # then add stream handler and remove file handler.
139  self.logger_stream_handler = logging.StreamHandler()
140  self.logger_stream_handler.setFormatter(self.logger_formatter)
141  for _, logger in six.iteritems(self.logger):
142  logger.addHandler(self.logger_stream_handler)
143  if self.logger_file_handler:
144  logger.removeHandler(self.logger_file_handler)
145 

◆ logger_format() [1/2]

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.logger_format (   self)
The logger format.

The logger_formatter will be updated when sets logger_format.

:param value: The format string.
:type: str

Definition at line 178 of file configuration.py.

178  def logger_format(self):
179  """The logger format.
180 
181  The logger_formatter will be updated when sets logger_format.
182 
183  :param value: The format string.
184  :type: str
185  """
186  return self.__logger_format
187 

◆ logger_format() [2/2]

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.logger_format (   self,
  value 
)
The logger format.

The logger_formatter will be updated when sets logger_format.

:param value: The format string.
:type: str

Definition at line 189 of file configuration.py.

189  def logger_format(self, value):
190  """The logger format.
191 
192  The logger_formatter will be updated when sets logger_format.
193 
194  :param value: The format string.
195  :type: str
196  """
197  self.__logger_format = value
198  self.logger_formatter = logging.Formatter(self.__logger_format)
199 

◆ to_debug_report()

def cFSPlib.python_api_client.swagger_client.configuration.Configuration.to_debug_report (   self)
Gets the essential information for debugging.

:return: The report for debugging.

Definition at line 234 of file configuration.py.

234  def to_debug_report(self):
235  """Gets the essential information for debugging.
236 
237  :return: The report for debugging.
238  """
239  return "Python SDK Debug Report:\n"\
240  "OS: {env}\n"\
241  "Python Version: {pyversion}\n"\
242  "Version of the API: 0.8\n"\
243  "SDK Package Version: 1.0.0".\
244  format(env=sys.platform, pyversion=sys.version)

Member Data Documentation

◆ api_key

cFSPlib.python_api_client.swagger_client.configuration.Configuration.api_key

Definition at line 55 of file configuration.py.

◆ api_key_prefix

cFSPlib.python_api_client.swagger_client.configuration.Configuration.api_key_prefix

Definition at line 57 of file configuration.py.

◆ assert_hostname

cFSPlib.python_api_client.swagger_client.configuration.Configuration.assert_hostname

Definition at line 90 of file configuration.py.

◆ cert_file

cFSPlib.python_api_client.swagger_client.configuration.Configuration.cert_file

Definition at line 86 of file configuration.py.

◆ connection_pool_maxsize

cFSPlib.python_api_client.swagger_client.configuration.Configuration.connection_pool_maxsize

Definition at line 97 of file configuration.py.

◆ debug

cFSPlib.python_api_client.swagger_client.configuration.Configuration.debug

Definition at line 77 of file configuration.py.

◆ host

cFSPlib.python_api_client.swagger_client.configuration.Configuration.host

Definition at line 49 of file configuration.py.

◆ key_file

cFSPlib.python_api_client.swagger_client.configuration.Configuration.key_file

Definition at line 88 of file configuration.py.

◆ logger

cFSPlib.python_api_client.swagger_client.configuration.Configuration.logger

Definition at line 65 of file configuration.py.

◆ logger_file

cFSPlib.python_api_client.swagger_client.configuration.Configuration.logger_file

Definition at line 75 of file configuration.py.

◆ logger_file_handler

cFSPlib.python_api_client.swagger_client.configuration.Configuration.logger_file_handler

Definition at line 73 of file configuration.py.

◆ logger_format

cFSPlib.python_api_client.swagger_client.configuration.Configuration.logger_format

Definition at line 69 of file configuration.py.

◆ logger_formatter

cFSPlib.python_api_client.swagger_client.configuration.Configuration.logger_formatter

Definition at line 198 of file configuration.py.

◆ logger_stream_handler

cFSPlib.python_api_client.swagger_client.configuration.Configuration.logger_stream_handler

Definition at line 71 of file configuration.py.

◆ password

cFSPlib.python_api_client.swagger_client.configuration.Configuration.password

Definition at line 63 of file configuration.py.

◆ proxy

cFSPlib.python_api_client.swagger_client.configuration.Configuration.proxy

Definition at line 100 of file configuration.py.

◆ refresh_api_key_hook

cFSPlib.python_api_client.swagger_client.configuration.Configuration.refresh_api_key_hook

Definition at line 59 of file configuration.py.

◆ safe_chars_for_path_param

cFSPlib.python_api_client.swagger_client.configuration.Configuration.safe_chars_for_path_param

Definition at line 102 of file configuration.py.

◆ ssl_ca_cert

cFSPlib.python_api_client.swagger_client.configuration.Configuration.ssl_ca_cert

Definition at line 84 of file configuration.py.

◆ temp_folder_path

cFSPlib.python_api_client.swagger_client.configuration.Configuration.temp_folder_path

Definition at line 51 of file configuration.py.

◆ username

cFSPlib.python_api_client.swagger_client.configuration.Configuration.username

Definition at line 61 of file configuration.py.

◆ verify_ssl

cFSPlib.python_api_client.swagger_client.configuration.Configuration.verify_ssl

Definition at line 82 of file configuration.py.


The documentation for this class was generated from the following file: