Obtain authentication information to utilize Swift file transfer services with the Virtual Watershed Platform.
Requires proper authentication.
Request Parameters
Route Parameters
Query Parameters
Examples
Obtain a token using python
s = requests.Session()
login = s.get('https://vwp-dev.unm.edu/apilogin', auth=('yourusername','yourpassword'), verify=False)
rawtoken = s.get('https://vwp-dev.unm.edu/gettoken')
tokenjson = json.loads(rawtoken.text)
print tokenjson['preauthurl']
print tokenjson['preauthtoken']
Response
Returns a json with two fields.
preauthurl: the url to use for swift uploads
preauthtoken: the authentication token to use for swift uploads
Use these tokens to establish a connection to swift as in the following example:
swift upload [modelid] -S 1073741824 [filename] --os-storage-url=[preauthurl] --os-auth-token=[preauthtoken]
This will upload a file to a container with the model id of your model run to the url you were passed using the token for authentication.
For a full use case, see documentation for Dataset Upload (Swift).