Droplet
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
RESTful API

Functions specific to RESTful API (S3, CDMI, sproxyd, SRWS, etc) More...

Functions

const char * dpl_get_backend_name (dpl_ctx_t *ctx)
 return the name of the backend currently used More...
 
dpl_status_t dpl_get_capabilities (dpl_ctx_t *ctx, dpl_capability_t *maskp)
 get the backend capabilities More...
 
dpl_status_t dpl_login (dpl_ctx_t *ctx)
 login More...
 
dpl_status_t dpl_list_all_my_buckets (dpl_ctx_t *ctx, dpl_vec_t **vecp)
 list all buckets More...
 
dpl_status_t dpl_list_bucket (dpl_ctx_t *ctx, const char *bucket, const char *prefix, const char *delimiter, const int max_keys, dpl_vec_t **objectsp, dpl_vec_t **common_prefixesp)
 list bucket or directory More...
 
dpl_status_t dpl_make_bucket (dpl_ctx_t *ctx, const char *bucket, dpl_location_constraint_t location_constraint, dpl_canned_acl_t canned_acl)
 make a bucket More...
 
dpl_status_t dpl_delete_bucket (dpl_ctx_t *ctx, const char *bucket)
 delete a path More...
 
dpl_status_t dpl_post (dpl_ctx_t *ctx, const char *bucket, const char *path, const dpl_option_t *option, dpl_ftype_t object_type, const dpl_condition_t *condition, const dpl_range_t *range, const dpl_dict_t *metadata, const dpl_sysmd_t *sysmd, const char *data_buf, unsigned int data_len, const dpl_dict_t *query_params, dpl_sysmd_t *returned_sysmdp)
 create or post data into a path More...
 
dpl_status_t dpl_put (dpl_ctx_t *ctx, const char *bucket, const char *path, const dpl_option_t *option, dpl_ftype_t object_type, const dpl_condition_t *condition, const dpl_range_t *range, const dpl_dict_t *metadata, const dpl_sysmd_t *sysmd, const char *data_buf, unsigned int data_len)
 put a path More...
 
dpl_status_t dpl_get (dpl_ctx_t *ctx, const char *bucket, const char *path, const dpl_option_t *option, dpl_ftype_t object_type, const dpl_condition_t *condition, const dpl_range_t *range, char **data_bufp, unsigned int *data_lenp, dpl_dict_t **metadatap, dpl_sysmd_t *sysmdp)
 get a path with range More...
 
dpl_status_t dpl_head (dpl_ctx_t *ctx, const char *bucket, const char *path, const dpl_option_t *option, dpl_ftype_t object_type, const dpl_condition_t *condition, dpl_dict_t **metadatap, dpl_sysmd_t *sysmdp)
 get user and system metadata More...
 
dpl_status_t dpl_head_raw (dpl_ctx_t *ctx, const char *bucket, const char *path, const dpl_option_t *option, dpl_ftype_t object_type, const dpl_condition_t *condition, dpl_dict_t **metadatap)
 get raw metadata More...
 
dpl_status_t dpl_delete (dpl_ctx_t *ctx, const char *bucket, const char *path, const dpl_option_t *option, dpl_ftype_t object_type, const dpl_condition_t *condition)
 delete a path More...
 
dpl_status_t dpl_post_id (dpl_ctx_t *ctx, const char *bucket, const char *id, const dpl_option_t *option, dpl_ftype_t object_type, const dpl_condition_t *condition, const dpl_range_t *range, const dpl_dict_t *metadata, const dpl_sysmd_t *sysmd, const char *data_buf, unsigned int data_len, const dpl_dict_t *query_params, dpl_sysmd_t *returned_sysmdp)
 create or post data into a path More...
 
dpl_status_t dpl_genurl (dpl_ctx_t *ctx, const char *bucket, const char *path, const dpl_option_t *option, time_t expires, char *buf, unsigned int len, unsigned int *lenp)
 generate a valid URL for sharing object More...
 
dpl_status_t dpl_copy (dpl_ctx_t *ctx, const char *src_bucket, const char *src_path, const char *dst_bucket, const char *dst_path, const dpl_option_t *option, dpl_ftype_t object_type, dpl_copy_directive_t copy_directive, const dpl_dict_t *metadata, const dpl_sysmd_t *sysmd, const dpl_condition_t *condition)
 perform various flavors of server side copies More...
 

Detailed Description

This is the abstraction layer fo all backends (S3, CDMI, sproxyd, SRWS, etc). Mainly, this API is used for PUTting, GETting and DELETing objects, but also manipulating the object attributes. For backends that has bucket support, this API allows to create/list/destroy buckets,

Users are supposed to call these functions as opposed to using the backend functions directly.

Configuring the backend is done is the profile dictionnary or the profile configuration file (see dpl_ctx_new())

Function Documentation

dpl_status_t dpl_copy ( dpl_ctx_t ctx,
const char *  src_bucket,
const char *  src_path,
const char *  dst_bucket,
const char *  dst_path,
const dpl_option_t option,
dpl_ftype_t  object_type,
dpl_copy_directive_t  copy_directive,
const dpl_dict_t metadata,
const dpl_sysmd_t sysmd,
const dpl_condition_t condition 
)
Parameters
ctxthe droplet context
src_bucketthe optional source bucket
src_paththe mandat source path
dst_bucketthe optional destination bucket
dst_paththe optional destination path (if dst equals src)
optionunused
object_typeunused
copy_directiveDPL_COPY_DIRECTIVE_COPY server side copy
copy_directiveDPL_COPY_DIRECTIVE_METADATA_REPLACE setattr
copy_directiveDPL_COPY_DIRECTIVE_LINK hard link
copy_directiveDPL_COPY_DIRECTIVE_SYMLINK reference
copy_directiveDPL_COPY_DIRECTIVE_MOVE rename
copy_directiveDPL_COPY_DIRECTIVE_MKDENT create a directory entry
metadatathe optional user metadata
sysmdthe optional system metadata
conditionthe optional condition
Returns
DPL_SUCCESS
DPL_FAILURE
dpl_status_t dpl_delete ( dpl_ctx_t ctx,
const char *  bucket,
const char *  path,
const dpl_option_t option,
dpl_ftype_t  object_type,
const dpl_condition_t condition 
)
Parameters
ctxthe droplet context
bucketthe optional bucket
paththe mandat path
optionDPL_OPTION_HTTP_COMPAT use if possible the HTTP compat mode
conditionthe optional condition
Returns
DPL_SUCCESS
DPL_FAILURE
DPL_ENOENT path does not exist
dpl_status_t dpl_delete_bucket ( dpl_ctx_t ctx,
const char *  bucket 
)
Parameters
ctxthe droplet context
bucketcan be NULL
Returns
DPL_SUCCESS
DPL_FAILURE
dpl_status_t dpl_genurl ( dpl_ctx_t ctx,
const char *  bucket,
const char *  path,
const dpl_option_t option,
time_t  expires,
char *  buf,
unsigned int  len,
unsigned int *  lenp 
)
Parameters
ctxthe droplet context
bucketthe optional bucket
paththe mandat path
optionunused
expiresexpire time of URL
bufURL is created in this buffer
lenbuffer length
lenpreal buffer returned
Returns
DPL_SUCCESS
DPL_FAILURE
dpl_status_t dpl_get ( dpl_ctx_t ctx,
const char *  bucket,
const char *  path,
const dpl_option_t option,
dpl_ftype_t  object_type,
const dpl_condition_t condition,
const dpl_range_t range,
char **  data_bufp,
unsigned int *  data_lenp,
dpl_dict_t **  metadatap,
dpl_sysmd_t sysmdp 
)
Parameters
ctxthe droplet context
bucketthe optional bucket
paththe mandat path
optionDPL_OPTION_HTTP_COMPAT use if possible the HTTP compat mode
object_typeDPL_FTYPE_ANY get any type of path
conditionthe optional condition
rangethe optional range
data_bufpthe returned data buffer client shall free
data_lenpthe returned data length
metadatapthe returned user metadata client shall free
sysmdpthe returned system metadata passed through stack
Returns
DPL_SUCCESS
DPL_FAILURE
DPL_ENOENT path does not exist
const char* dpl_get_backend_name ( dpl_ctx_t ctx)
Parameters
ctx
Returns
the backend name
dpl_status_t dpl_get_capabilities ( dpl_ctx_t ctx,
dpl_capability_t *  maskp 
)
Parameters
ctxdroplet context
[out]maskpa pointer to mask
dpl_status_t dpl_head ( dpl_ctx_t ctx,
const char *  bucket,
const char *  path,
const dpl_option_t option,
dpl_ftype_t  object_type,
const dpl_condition_t condition,
dpl_dict_t **  metadatap,
dpl_sysmd_t sysmdp 
)
Parameters
ctxthe droplet context
bucketthe optional bucket
paththe mandat path
optionDPL_OPTION_HTTP_COMPAT use if possible the HTTP compat mode
object_typeDPL_FTYPE_ANY get any type of path
conditionthe optional condition
metadatapthe returned user metadata client shall free
sysmdpthe returned system metadata passed through stack
Returns
DPL_SUCCESS
DPL_FAILURE
DPL_ENOENT path does not exist
dpl_status_t dpl_head_raw ( dpl_ctx_t ctx,
const char *  bucket,
const char *  path,
const dpl_option_t option,
dpl_ftype_t  object_type,
const dpl_condition_t condition,
dpl_dict_t **  metadatap 
)
Parameters
ctxthe droplet context
bucketthe optional bucket
paththe mandat path
optionDPL_OPTION_HTTP_COMPAT use if possible the HTTP compat mode
conditionthe optional condition
metadatapthe returned metadata client shall free
Returns
DPL_SUCCESS
DPL_FAILURE
DPL_ENOENT
dpl_status_t dpl_list_all_my_buckets ( dpl_ctx_t ctx,
dpl_vec_t **  vecp 
)
Parameters
ctxthe droplect context
vecpa vector of dpl_bucket_t *
Returns
DPL_SUCCESS
DPL_FAILURE
dpl_status_t dpl_list_bucket ( dpl_ctx_t ctx,
const char *  bucket,
const char *  prefix,
const char *  delimiter,
const int  max_keys,
dpl_vec_t **  objectsp,
dpl_vec_t **  common_prefixesp 
)
Parameters
ctxthe droplet context
bucketcan be NULL
prefixdirectory can be NULL
delimitere.g. "/" can be NULL
maxnumber of keys we want to get (-1 for no limit)
objectspvector of dpl_object_t * (files)
prefixespvector of dpl_common_prefix_t * (directories)
Returns
DPL_SUCCESS
DPL_FAILURE
dpl_status_t dpl_login ( dpl_ctx_t ctx)
Parameters
ctxdroplet context
dpl_status_t dpl_make_bucket ( dpl_ctx_t ctx,
const char *  bucket,
dpl_location_constraint_t  location_constraint,
dpl_canned_acl_t  canned_acl 
)
Parameters
ctxthe droplet context
bucketcan be NULL
location_constraintgeographic location
canned_aclsimplified ACL
Returns
DPL_SUCCESS
DPL_FAILURE
dpl_status_t dpl_post ( dpl_ctx_t ctx,
const char *  bucket,
const char *  path,
const dpl_option_t option,
dpl_ftype_t  object_type,
const dpl_condition_t condition,
const dpl_range_t range,
const dpl_dict_t metadata,
const dpl_sysmd_t sysmd,
const char *  data_buf,
unsigned int  data_len,
const dpl_dict_t query_params,
dpl_sysmd_t returned_sysmdp 
)
Note
this function is expected to return a newly created object
Parameters
ctxthe droplet context
bucketcan be NULL
pathcan be NULL
optionDPL_OPTION_HTTP_COMPAT use if possible the HTTP compat mode
object_typeDPL_FTYPE_REG create a file
metadatathe user metadata. optional
sysmdthe system metadata. optional
data_bufthe data buffer
data_lenthe data length
query_paramscan be NULL
returned_sysmdpthe returned system metadata passed through stack
Returns
DPL_SUCCESS
DPL_FAILURE
dpl_status_t dpl_post_id ( dpl_ctx_t ctx,
const char *  bucket,
const char *  id,
const dpl_option_t option,
dpl_ftype_t  object_type,
const dpl_condition_t condition,
const dpl_range_t range,
const dpl_dict_t metadata,
const dpl_sysmd_t sysmd,
const char *  data_buf,
unsigned int  data_len,
const dpl_dict_t query_params,
dpl_sysmd_t returned_sysmdp 
)
Note
this function is expected to return a newly created object
Parameters
ctx
bucket
pathcan be NULL
object_type
metadata
canned_acl
data_buf
data_len
query_paramscan be NULL
returned_sysmdp
Returns
dpl_status_t dpl_put ( dpl_ctx_t ctx,
const char *  bucket,
const char *  path,
const dpl_option_t option,
dpl_ftype_t  object_type,
const dpl_condition_t condition,
const dpl_range_t range,
const dpl_dict_t metadata,
const dpl_sysmd_t sysmd,
const char *  data_buf,
unsigned int  data_len 
)
Parameters
ctxthe droplet context
bucketoptional
pathmandatory
optionDPL_OPTION_HTTP_COMPAT use if possible the HTTP compat mode
object_typeDPL_FTYPE_REG create a file
object_typeDPL_FTYPE_DIR create a directory
conditionthe optional condition
rangeoptional range
metadatathe optional user metadata
sysmdthe optional system metadata
data_bufthe data buffer
data_lenthe data length
Returns
DPL_SUCCESS
DPL_FAILURE
DPL_EEXIST