Dell DX6004S DX Object Storage Application Guide - Page 56

Example: Creating Bucket Owners, 4. Examples of Creating Buckets and Named Objects

Page 56 highlights

An example of creating a bucket and uploading a realm follows: curl -H "Castor-Authorization: authorization-specification/bucket-name" -H "Castor-Stream-Type: admin" --data-binary @realm --anyauth -u "authorizeduser-name:password" --post301 --location-trusted http://node-ip/bucketname [-D log-file-name] An example of getting the authorization list for a bucket follows: curl --anyauth -u "authorized-user-name: password" --location-trusted node-ip/bucket-name [-D log-file-name] 13.3. Example: Creating Bucket Owners The following example creates cluster.example.com/mybucket and enables users in that realm to create named objects in mybucket. Other users in cluster.example.com can perform all other operations in mybucket (such as COPY, APPEND, DELETE, and so on). In the example, cluster.example.com is the default cluster domain so you do not have to explicitly send it as the Host in the request. curl -X POST -H "Castor-Authorization: post=cluster.example.com/mybucket" -H "Castor-Stream-Type: admin" --data-binary @cluster_domain_com_mybucket --anyauth -u "authorized-user-name:password" --location-trusted http:// cluster.example.com/mybucket --post301 -D mybucketrealm.log To update the user list later, use APPEND, which is does not replace an existing user list. PUT replaces the user list, which might disable other users' access to the bucket. If you use APPEND to update a user list, you do not need to set the Castor-Authorization header. 13.4. Examples of Creating Buckets and Named Objects The following examples assume you have privileges to create a bucket named mybucket and to create objects in mybucket. Security assumptions: • Your cluster administrator created one domain named cluster.example.com, which is the default cluster domain. Therefore, you do not need to specify a domain name as the Host in any commands. • Your domain manager created two users named john.rogers and jane.lalane, and the users' passwords are the same as the users' first names. These users can create buckets in cluster.example.com. • You can create your own buckets and set security on your buckets, if desired. • You can set security for named objects you are authorized to create. Other assumptions: • You execute all commands using curl. • You send your commands to a node whose IP address is 172.16.0.35. Copyright © 2010 Caringo, Inc. All rights reserved 51 Version 5.0 December 2010

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81

Copyright © 2010 Caringo, Inc.
All rights reserved
51
Version 5.0
December 2010
An example of creating a bucket and uploading a realm follows:
curl -H "Castor-Authorization:
authorization-specification
/
bucket-name
" -H
"Castor-Stream-Type: admin" --data-binary @
realm
--anyauth -u "
authorized-
user-name
:
password
" --post301 --location-trusted http://
node-ip
/
bucket-
name
[-D
log-file-name
]
An example of getting the authorization list for a bucket follows:
curl --anyauth -u "
authorized-user-name
:
password
" --location-trusted
node-ip
/
bucket-name
[-D
log-file-name
]
13.3. Example: Creating Bucket Owners
The following example creates
cluster.example.com/mybucket
and enables users in that
realm to create named objects in
mybucket
. Other users in
cluster.example.com
can perform
all other operations in mybucket (such as COPY, APPEND, DELETE, and so on).
In the example,
cluster.example.com
is the default cluster domain so you do not have to
explicitly send it as the Host in the request.
curl -X POST -H "Castor-Authorization: post=cluster.example.com/mybucket"
-H "Castor-Stream-Type: admin" --data-binary @cluster_domain_com_mybucket
--anyauth -u "
authorized-user-name
:
password
" --location-trusted http://
cluster.example.com/mybucket --post301 -D mybucketrealm.log
To update the user list later, use APPEND, which is does not replace an existing user list. PUT
replaces the user list, which might disable other users' access to the bucket. If you use APPEND to
update a user list, you do not need to set the
Castor-Authorization
header.
13.4. Examples of Creating Buckets and Named Objects
The following examples assume you have privileges to create a bucket named
mybucket
and to
create objects in
mybucket
.
Security assumptions:
Your cluster administrator created one domain named
cluster.example.com
, which is the
default cluster domain. Therefore, you do not need to specify a domain name as the Host in any
commands.
Your domain manager created two users named
john.rogers
and
jane.lalane
, and the
users' passwords are the same as the users' first names. These users can create buckets in
cluster.example.com
.
You can create your own buckets and set security on your buckets, if desired.
You can set security for named objects you are authorized to create.
Other assumptions:
You execute all commands using
curl
.
You send your commands to a node whose IP address is 172.16.0.35.