Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
4842c5b4
Commit
4842c5b4
authored
Aug 21, 2019
by
Markus Scheidgen
Browse files
Provide upload command as http.
parent
4390f471
Pipeline
#54095
passed with stages
in 16 minutes and 49 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/api/upload.py
View file @
4842c5b4
...
...
@@ -528,7 +528,7 @@ class UploadCommandResource(Resource):
@
login_really_required
def
get
(
self
):
""" Get url and example command for shell based uploads. """
upload_url
=
'%s/uploads/?curl=True'
%
config
.
api_url
()
upload_url
=
'%s/uploads/?curl=True'
%
config
.
api_url
(
ssl
=
False
)
upload_url_with_name
=
upload_url
+
'&name=<name>'
# upload_command = 'curl -X PUT -H "X-Token: %s" "%s" -F file=@<local_file>' % (
...
...
nomad/config.py
View file @
4842c5b4
...
...
@@ -156,11 +156,10 @@ tests = NomadConfig(
)
def
api_url
():
return
'%s://%s%s
%s
'
%
(
'https'
if
services
.
https
else
'http'
,
def
api_url
(
ssl
:
bool
=
True
):
return
'%s://%s%s'
%
(
'https'
if
services
.
https
and
ssl
else
'http'
,
services
.
api_host
,
':%s'
%
services
.
api_port
if
int
(
services
.
api_port
)
!=
80
else
''
,
services
.
api_base_path
)
...
...
Write
Preview
Supports
Markdown
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