Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
c1660b31
Commit
c1660b31
authored
Aug 13, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #56 in RMS/api-main-service from gladys-develop to dev
* commit '
c064197d
': download api
parents
e8353f0e
c064197d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
2 deletions
+14
-2
api/views.py
api/views.py
+10
-0
config/settings/local.py
config/settings/local.py
+1
-1
config/settings/uat.py
config/settings/uat.py
+1
-1
config/urls.py
config/urls.py
+2
-0
No files found.
api/views.py
View file @
c1660b31
...
...
@@ -3,6 +3,7 @@ from rest_framework.response import Response
from
.utils
import
Helper
from
django.conf
import
settings
from
django.http
import
FileResponse
import
requests
class
APIGatewayList
(
APIView
):
...
...
@@ -91,3 +92,12 @@ class APIGatewaySlugModelDetail(APIView):
def
delete
(
self
,
request
,
format
=
None
,
**
kwargs
):
return
self
.
_response
(
request
,
**
kwargs
)
class
Download
(
APIView
):
def
post
(
self
,
request
,
**
kwargs
):
print
(
"hello"
)
req
=
requests
.
get
(
request
.
body
.
get
(
"url"
))
return
FileResponse
(
req
,
as_attachment
=
True
)
config/settings/local.py
View file @
c1660b31
...
...
@@ -33,4 +33,4 @@ AUTHENTICATOR_IP = config['SERVICE']['AUTHENTICATOR_IP']
AUTHENTICATOR_PATH
=
'/api/v1/authenticator'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-validate-token/'
AUTHENTICATOR_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-group'
AUTHENTICATOR_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-group'
\ No newline at end of file
config/settings/uat.py
View file @
c1660b31
...
...
@@ -33,4 +33,4 @@ AUTHENTICATOR_IP = config['SERVICE']['AUTHENTICATOR_IP']
AUTHENTICATOR_PATH
=
'/api/v1/authenticator'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-validate-token/'
AUTHENTICATOR_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-group'
AUTHENTICATOR_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-group'
\ No newline at end of file
config/urls.py
View file @
c1660b31
...
...
@@ -15,10 +15,12 @@ Including another URLconf
"""
from
django.urls
import
path
,
include
from
rest_framework_swagger.views
import
get_swagger_view
from
api.views
import
(
Download
)
swagger
=
get_swagger_view
(
title
=
'API Main End Point'
)
urlpatterns
=
[
path
(
'docs/'
,
swagger
),
path
(
'api/v1/'
,
include
(
'api.urls'
)),
path
(
'api/v1/download/'
,
Download
.
as_view
()),
]
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