Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tablestorageflask
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
tablestorageflask
Commits
49c2fe1f
Commit
49c2fe1f
authored
Oct 15, 2020
by
dasharatha.vamshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file
parent
18595a18
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
tablestorage.py
tablestorage.py
+44
-0
No files found.
tablestorage.py
0 → 100644
View file @
49c2fe1f
from
azure.cosmosdb.table.tableservice
import
TableService
from
azure.cosmosdb.table.models
import
Entity
import
os
from
flask
import
Flask
,
jsonify
from
flask
import
Flask
,
redirect
,
url_for
,
request
app
=
Flask
(
__name__
)
@
app
.
route
(
'/'
)
def
hello
():
return
"Hello World!"
@
app
.
route
(
'/getLogs'
,
methods
=
[
"GET"
,
"POST"
])
def
getLogs
():
try
:
if
request
.
method
==
"POST"
:
content
=
request
.
get_json
()
conid
=
content
[
'conid'
]
table_service
=
TableService
(
account_name
=
'azradlppb'
,
account_key
=
'VLhJjo77rwYnHWaeNh2UlEdswUypR0uWSTyLn6Hu9SWlAYtujHymXZxdFo9kuEK5WcpDwBySpOjizcqxd3hMHA=='
)
tasks
=
table_service
.
query_entities
(
'logs'
,
filter
=
"PartitionKey eq '{0}'"
.
format
(
conid
))
ouput
=
{}
data
=
{
"status"
:
True
,
"message"
:
"success"
,
"data"
:
[
]
}
for
task
in
tasks
:
print
(
task
)
data
[
'data'
]
.
append
(
task
)
return
jsonify
(
data
)
except
Exception
as
e
:
return
jsonify
({
'status'
:
False
,
'message'
:
str
(
e
)})
if
__name__
==
'__main__'
:
app
.
run
()
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