Variables
The curl commands below can be used directly if you define the following variables in your shell
No Format |
---|
host=dev.duracloud.org
space-0=<any-name>
space-1=<any-name>
user=<username>
pword=<password>
file=<any-file-name>
# create a temp file
echo hello > ${file}
|
DuraStore
...
Get Stores
...
No Format |
---|
curl -u ${user}:${pword} https://${host}/durastore/stores
|
...
Get Spaces
...
No Format |
---|
curl -u ${user}:${pword} https://${host}/durastore/spaces
curl -u ${user}:${pword} https://${host}/durastore/spaces?storeID=1
|
...
Create Space
...
No Format |
---|
curl -u ${user}:${pword} -X PUT https://${host}/durastore/${space-0}
curl -u ${user}:${pword} -H "x-dura-meta-city: arlington" -H "x-dura-meta-state: va" -X PUT https://${host}/durastore/${space-1}?storeID=1
|
...
Store Content
...
No Format |
---|
curl -u ${user}:${pword} -T ${file} https://${host}/durastore/${space-0}/test.txt
curl -u ${user}:${pword} -T ${file} https://${host}/durastore/${space-0}/item.txt
|
...
Get Space
...
No Format |
---|
curl -u ${user}:${pword} https://${host}/durastore/${space-0}
curl -u ${user}:${pword} https://${host}/durastore/${space-1}?storeID=1
curl -u ${user}:${pword} https://${host}/durastore/${space-0}?prefix=test
|
...
Set Space Metadata
...
No Format |
---|
curl -u ${user}:${pword} -H "x-dura-meta-country: usa" -X POST https://${host}/durastore/${space-0}
|
...
Get Space Metadata
...
No Format |
---|
curl -u ${user}:${pword} -I https://${host}/durastore/${space-0}
curl -u ${user}:${pword} -I https://${host}/durastore/${space-1}?storeID=1
|
...
Get Content
...
No Format |
---|
curl -u ${user}:${pword} https://${host}/durastore/${space-0}/test.txt
curl -u ${user}:${pword} https://${host}/durastore/${space-0}/test.txt?storeID=0\&attachment=true
|
...
Set Content Metadata
...
No Format |
---|
curl -u ${user}:${pword} -X POST -H "x-dura-meta-color: green" https://${host}/durastore/${space-0}/test.txt
|
...
Get Content Metadata
...
No Format |
---|
curl -u ${user}:${pword} -I https://${host}/durastore/${space-0}/test.txt
|
...
Delete Content
...
No Format |
---|
curl -u ${user}:${pword} -X DELETE https://${host}/durastore/${space-0}/test.txt
|
...
Delete Space
...
No Format |
---|
curl -u ${user}:${pword} -X DELETE https://${host}/durastore/${space-0}
curl -u ${user}:${pword} -X DELETE https://${host}/durastore/${space-1}?storeID=1
|