Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
http-request-component
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dasharatha.vamshi
http-request-component
Commits
49ebafdc
Commit
49ebafdc
authored
Feb 22, 2021
by
dasharatha.vamshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
70dadae4
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10053 additions
and
9 deletions
+10053
-9
logs/HttpRequestComponent.log
logs/HttpRequestComponent.log
+27
-0
main.py
main.py
+1
-1
scripts/common/__pycache__/config_parser.cpython-37.pyc
scripts/common/__pycache__/config_parser.cpython-37.pyc
+0
-0
scripts/common/config_parser.py
scripts/common/config_parser.py
+9
-8
test/response.json
test/response.json
+10016
-0
No files found.
logs/HttpRequestComponent.log
View file @
49ebafdc
...
...
@@ -84,3 +84,30 @@
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,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
main.py
View file @
49ebafdc
...
...
@@ -43,7 +43,7 @@ class RequestComponent:
self
.
s
.
auth
=
(
request_auth
[
RequestConstants
.
Request_auth_username
],
request_auth
[
RequestConstants
.
Request_auth_password
])
except
Exception
as
e
:
raise
Exception
(
e
)
logger
.
info
(
"Proceeding without authentication because username and password are missing"
)
else
:
logger
.
info
(
"Proceeding without authentication"
)
...
...
scripts/common/__pycache__/config_parser.cpython-37.pyc
View file @
49ebafdc
No preview for this file type
scripts/common/config_parser.py
View file @
49ebafdc
...
...
@@ -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_HANDLER_NAME
=
_config
.
get
(
'SERVICE_CONFIG'
,
{})
.
get
(
"LOG_HANDLER_NAME"
,
"HttpRequestComponent"
)
# os.environ['shared_volume'] = 'test'
# os.environ['method'] = 'POST'
# os.environ['url'] = 'http://localhost:5000/get'
# os.environ['headers'] = '{"content-type":"application/json"}'
# os.environ['payload'] = '{"name": "vamshi", "gender": "male"}'
# os.environ['max_retries'] = '1'
os
.
environ
[
'shared_volume'
]
=
'test'
os
.
environ
[
'method'
]
=
'GET'
os
.
environ
[
'url'
]
=
'https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/aluva?unitGroup=metric&key=QMCRVJEPKK8YD7BP83BZTMZ7A'
os
.
environ
[
'headers'
]
=
'{}'
os
.
environ
[
'payload'
]
=
'{}'
os
.
environ
[
'max_retries'
]
=
'1'
# os.environ['authentication'] = '{"username":"vamshi","password":"sai"}'
config
=
{
"shared_volume"
:
os
.
environ
.
get
(
"shared_volume"
),
"method"
:
os
.
environ
.
get
(
"method"
),
"url"
:
os
.
environ
.
get
(
"url"
),
"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"
)),
"authentication"
:
json
.
loads
(
os
.
environ
.
get
(
"authentication"
))
"authentication"
:
json
.
loads
(
os
.
environ
.
get
(
"authentication"
,
default
=
'{}'
))
}
if
not
os
.
path
.
exists
(
config
[
'shared_volume'
]):
sys
.
stderr
.
write
(
"Shared path does not exist!"
)
...
...
test/response.json
0 → 100644
View file @
49ebafdc
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment