Commit 49ebafdc authored by dasharatha.vamshi's avatar dasharatha.vamshi

init

parent 70dadae4
...@@ -84,3 +84,30 @@ ...@@ -84,3 +84,30 @@
2021-02-22 10:45:28,879 INFO HttpRequestComponent Parsing user requests 2021-02-22 10:45:28,879 INFO HttpRequestComponent Parsing user requests
2021-02-22 10:45:30,913 INFO HttpRequestComponent Receiving data... 2021-02-22 10:45:30,913 INFO HttpRequestComponent Receiving data...
2021-02-22 10:45:30,914 INFO HttpRequestComponent Writing data to response.json file 2021-02-22 10:45:30,914 INFO HttpRequestComponent Writing data to response.json file
2021-02-22 15:51:47,076 INFO HttpRequestComponent Parsing user requests
2021-02-22 15:51:47,077 INFO HttpRequestComponent {'shared_volume': 'test', 'method': 'GET', 'url': 'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/aluva?unitGroup=metric&key=QMCRVJEPKK8YD7BP83BZTMZ7A', 'headers': {'content-type': 'application/json'}, 'payload': {'name': 'vamshi', 'gender': 'male'}, 'max_retries': 1, 'authentication': {'username': 'vamshi', 'password': 'sai'}}
2021-02-22 15:51:48,484 INFO HttpRequestComponent Receiving data...
2021-02-22 15:51:48,494 INFO HttpRequestComponent Writing data to response.json file
2021-02-22 16:10:25,894 INFO HttpRequestComponent Parsing user requests
2021-02-22 16:10:25,894 INFO HttpRequestComponent {'shared_volume': 'test', 'method': 'GET', 'url': 'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/aluva?unitGroup=metric&key=QMCRVJEPKK8YD7BP83BZTMZ7A', 'headers': {}, 'payload': {'name': 'vamshi', 'gender': 'male'}, 'max_retries': 1, 'authentication': {'username': 'vamshi', 'password': 'sai'}}
2021-02-22 16:10:27,280 INFO HttpRequestComponent Receiving data...
2021-02-22 16:10:27,295 INFO HttpRequestComponent Writing data to response.json file
2021-02-22 16:10:45,044 INFO HttpRequestComponent Parsing user requests
2021-02-22 16:10:45,044 INFO HttpRequestComponent {'shared_volume': 'test', 'method': 'GET', 'url': 'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/aluva?unitGroup=metric&key=QMCRVJEPKK8YD7BP83BZTMZ7A', 'headers': {}, 'payload': {'name': 'vamshi', 'gender': 'male'}, 'max_retries': 1, 'authentication': {'username': 'vamshi', 'password': 'sai'}}
2021-02-22 16:10:48,089 INFO HttpRequestComponent Receiving data...
2021-02-22 16:10:48,098 INFO HttpRequestComponent Writing data to response.json file
2021-02-22 16:40:31,252 INFO HttpRequestComponent Parsing user requests
2021-02-22 16:40:31,252 INFO HttpRequestComponent Proceeding without authentication
2021-02-22 16:40:31,253 INFO HttpRequestComponent {'shared_volume': 'test', 'method': 'GET', 'url': 'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/aluva?unitGroup=metric&key=QMCRVJEPKK8YD7BP83BZTMZ7A', 'headers': {}, 'payload': {}, 'max_retries': 1}
2021-02-22 16:40:34,281 INFO HttpRequestComponent Receiving data...
2021-02-22 16:40:34,293 INFO HttpRequestComponent Writing data to response.json file
2021-02-22 16:47:51,268 INFO HttpRequestComponent Parsing user requests
2021-02-22 16:47:51,268 INFO HttpRequestComponent Proceeding without authentication because username and password are missing
2021-02-22 16:47:51,269 INFO HttpRequestComponent {'shared_volume': 'test', 'method': 'GET', 'url': 'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/aluva?unitGroup=metric&key=QMCRVJEPKK8YD7BP83BZTMZ7A', 'headers': {}, 'payload': {}, 'max_retries': 1, 'authentication': {}}
2021-02-22 16:47:52,550 INFO HttpRequestComponent Receiving data...
2021-02-22 16:47:52,561 INFO HttpRequestComponent Writing data to response.json file
2021-02-22 16:48:36,795 INFO HttpRequestComponent Parsing user requests
2021-02-22 16:48:36,795 INFO HttpRequestComponent Proceeding without authentication because username and password are missing
2021-02-22 16:48:36,796 INFO HttpRequestComponent {'shared_volume': 'test', 'method': 'GET', 'url': 'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/aluva?unitGroup=metric&key=QMCRVJEPKK8YD7BP83BZTMZ7A', 'headers': {}, 'payload': {}, 'max_retries': 1, 'authentication': {}}
2021-02-22 16:48:37,991 INFO HttpRequestComponent Receiving data...
2021-02-22 16:48:38,001 INFO HttpRequestComponent Writing data to response.json file
...@@ -43,7 +43,7 @@ class RequestComponent: ...@@ -43,7 +43,7 @@ class RequestComponent:
self.s.auth = (request_auth[RequestConstants.Request_auth_username], self.s.auth = (request_auth[RequestConstants.Request_auth_username],
request_auth[RequestConstants.Request_auth_password]) request_auth[RequestConstants.Request_auth_password])
except Exception as e: except Exception as e:
raise Exception(e) logger.info("Proceeding without authentication because username and password are missing")
else: else:
logger.info("Proceeding without authentication") logger.info("Proceeding without authentication")
......
...@@ -22,21 +22,22 @@ if not os.path.exists(os.path.join(os.getcwd(), 'logs')): ...@@ -22,21 +22,22 @@ if not os.path.exists(os.path.join(os.getcwd(), 'logs')):
LOG_LEVEL = os.environ.get("LOG_LEVEL", _config.get('SERVICE_CONFIG', {}).get("LOG_LEVEL", "INFO")).upper() LOG_LEVEL = os.environ.get("LOG_LEVEL", _config.get('SERVICE_CONFIG', {}).get("LOG_LEVEL", "INFO")).upper()
LOG_HANDLER_NAME = _config.get('SERVICE_CONFIG', {}).get("LOG_HANDLER_NAME", "HttpRequestComponent") LOG_HANDLER_NAME = _config.get('SERVICE_CONFIG', {}).get("LOG_HANDLER_NAME", "HttpRequestComponent")
# os.environ['shared_volume'] = 'test' os.environ['shared_volume'] = 'test'
# os.environ['method'] = 'POST' os.environ['method'] = 'GET'
# os.environ['url'] = 'http://localhost:5000/get' os.environ[
# os.environ['headers'] = '{"content-type":"application/json"}' 'url'] = 'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/aluva?unitGroup=metric&key=QMCRVJEPKK8YD7BP83BZTMZ7A'
# os.environ['payload'] = '{"name": "vamshi", "gender": "male"}' os.environ['headers'] = '{}'
# os.environ['max_retries'] = '1' os.environ['payload'] = '{}'
os.environ['max_retries'] = '1'
# os.environ['authentication'] = '{"username":"vamshi","password":"sai"}' # os.environ['authentication'] = '{"username":"vamshi","password":"sai"}'
config = { config = {
"shared_volume": os.environ.get("shared_volume"), "shared_volume": os.environ.get("shared_volume"),
"method": os.environ.get("method"), "method": os.environ.get("method"),
"url": os.environ.get("url"), "url": os.environ.get("url"),
"headers": json.loads(os.environ.get("headers")), "headers": json.loads(os.environ.get("headers")),
"payload": json.loads(os.environ.get("payload")), "payload": json.loads(os.environ.get("payload", default='{}')),
"max_retries": int(os.environ.get("max_retries")), "max_retries": int(os.environ.get("max_retries")),
"authentication": json.loads(os.environ.get("authentication")) "authentication": json.loads(os.environ.get("authentication", default='{}'))
} }
if not os.path.exists(config['shared_volume']): if not os.path.exists(config['shared_volume']):
sys.stderr.write("Shared path does not exist!") sys.stderr.write("Shared path does not exist!")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment