DAOS API (v2.1 - dev)
Loading...
Searching...
No Matches
daos_s3.h
Go to the documentation of this file.
1/*
2 * (C) Copyright 2022 Intel Corporation.
3 *
4 * SPDX-License-Identifier: BSD-2-Clause-Patent
5 */
15#ifndef __DAOS_S3_H__
16#define __DAOS_S3_H__
17
18#if defined(__cplusplus)
19extern "C" {
20#endif
21
22#include <daos_event.h>
23#include <daos_fs.h>
24
26#define DS3_MAX_BUCKET_NAME DAOS_PROP_MAX_LABEL_BUF_LEN
27
29#define DS3_MAX_KEY (DFS_MAX_PATH - 8)
30
32#define DS3_MAX_KEY_BUFF DFS_MAX_PATH
33
35#define DS3_MAX_USER_NAME DFS_MAX_NAME
36
38#define DS3_MAX_UPLOAD_ID 35
39
41#define DS3_MAX_ENCODED_LEN DFS_MAX_XATTR_LEN
42
44#define DS3_LATEST_INSTANCE "latest"
45
47typedef struct ds3 ds3_t;
48
50typedef struct ds3_bucket ds3_bucket_t;
51
53typedef struct ds3_obj ds3_obj_t;
54
56typedef struct ds3_part ds3_part_t;
57
61 const char *name;
63 const char *email;
65 const char **access_ids;
67 const size_t access_ids_nr;
69 void *encoded;
72};
73
83
93
99
111
121
122/* General S3 */
123
129int
131
137int
139
153int
154ds3_connect(const char *pool, const char *sys, ds3_t **ds3, daos_event_t *ev);
155
165int
167
168/* S3 users */
169
182int
183ds3_user_set(const char *name, struct ds3_user_info *info, struct ds3_user_info *old_info,
184 ds3_t *ds3, daos_event_t *ev);
185
197int
198ds3_user_remove(const char *name, struct ds3_user_info *info, ds3_t *ds3, daos_event_t *ev);
199
211int
212ds3_user_get(const char *name, struct ds3_user_info *info, ds3_t *ds3, daos_event_t *ev);
213
225int
226ds3_user_get_by_email(const char *email, struct ds3_user_info *info, ds3_t *ds3, daos_event_t *ev);
227
239int
240ds3_user_get_by_key(const char *key, struct ds3_user_info *info, ds3_t *ds3, daos_event_t *ev);
241
242/* S3 Buckets */
243
261int
262ds3_bucket_list(daos_size_t *nbuck, struct ds3_bucket_info *buf, char *marker, bool *is_truncated,
263 ds3_t *ds3, daos_event_t *ev);
264
279int
280ds3_bucket_create(const char *name, struct ds3_bucket_info *info, dfs_attr_t *attr, ds3_t *ds3,
281 daos_event_t *ev);
282
294int
295ds3_bucket_destroy(const char *name, bool force, ds3_t *ds3, daos_event_t *ev);
296
308int
309ds3_bucket_open(const char *name, ds3_bucket_t **ds3b, ds3_t *ds3, daos_event_t *ev);
310
320int
322
333int
335
346int
348
371int
372ds3_bucket_list_obj(uint32_t *nobj, struct ds3_object_info *objs, uint32_t *ncp,
373 struct ds3_common_prefix_info *cps, const char *prefix, const char *delim,
374 char *marker, bool list_versions, bool *is_truncated, ds3_bucket_t *ds3b);
375
376/* S3 Objects */
377
387int
388ds3_obj_create(const char *key, ds3_obj_t **ds3o, ds3_bucket_t *ds3b);
389
399int
400ds3_obj_open(const char *key, ds3_obj_t **ds3o, ds3_bucket_t *ds3b);
401
409int
411
421int
423
433int
435
453int
454ds3_obj_read(void *buf, daos_off_t off, daos_size_t *size, ds3_bucket_t *ds3b, ds3_obj_t *ds3o,
455 daos_event_t *ev);
456
465int
466ds3_obj_destroy(const char *key, ds3_bucket_t *ds3b);
467
483int
484ds3_obj_write(void *buf, daos_off_t off, daos_size_t *size, ds3_bucket_t *ds3b, ds3_obj_t *ds3o,
485 daos_event_t *ev);
486
495int
496ds3_obj_mark_latest(const char *key, ds3_bucket_t *ds3b);
497
498/* S3 Multipart api */
499
523int
524ds3_bucket_list_multipart(const char *bucket_name, uint32_t *nmp,
525 struct ds3_multipart_upload_info *mps, uint32_t *ncp,
526 struct ds3_common_prefix_info *cps, const char *prefix, const char *delim,
527 char *marker, bool *is_truncated, ds3_t *ds3);
528
547int
548ds3_upload_list_parts(const char *bucket_name, const char *upload_id, uint32_t *npart,
549 struct ds3_multipart_part_info *parts, uint32_t *marker, bool *is_truncated,
550 ds3_t *ds3);
551
561int
562ds3_upload_init(struct ds3_multipart_upload_info *info, const char *bucket_name, ds3_t *ds3);
563
574int
575ds3_upload_remove(const char *bucket_name, const char *upload_id, ds3_t *ds3);
576
588int
589ds3_upload_get_info(struct ds3_multipart_upload_info *info, const char *bucket_name,
590 const char *upload_id, ds3_t *ds3);
591
604int
605ds3_part_open(const char *bucket_name, const char *upload_id, uint64_t part_num, bool truncate,
606 ds3_part_t **ds3p, ds3_t *ds3);
607
615int
617
633int
634ds3_part_write(void *buf, daos_off_t off, daos_size_t *size, ds3_part_t *ds3p, ds3_t *ds3,
635 daos_event_t *ev);
636
652int
653ds3_part_read(void *buf, daos_off_t off, daos_size_t *size, ds3_part_t *ds3p, ds3_t *ds3,
654 daos_event_t *ev);
655
667int
669 daos_event_t *ev);
670
671#if defined(__cplusplus)
672}
673#endif
674
675#endif /* __DAOS_S3_H__ */
int ds3_bucket_set_info(struct ds3_bucket_info *info, ds3_bucket_t *ds3b, daos_event_t *ev)
int ds3_obj_open(const char *key, ds3_obj_t **ds3o, ds3_bucket_t *ds3b)
int ds3_bucket_open(const char *name, ds3_bucket_t **ds3b, ds3_t *ds3, daos_event_t *ev)
int ds3_bucket_close(ds3_bucket_t *ds3b, daos_event_t *ev)
int ds3_upload_get_info(struct ds3_multipart_upload_info *info, const char *bucket_name, const char *upload_id, ds3_t *ds3)
int ds3_user_get_by_email(const char *email, struct ds3_user_info *info, ds3_t *ds3, daos_event_t *ev)
int ds3_user_get_by_key(const char *key, struct ds3_user_info *info, ds3_t *ds3, daos_event_t *ev)
int ds3_bucket_create(const char *name, struct ds3_bucket_info *info, dfs_attr_t *attr, ds3_t *ds3, daos_event_t *ev)
int ds3_part_open(const char *bucket_name, const char *upload_id, uint64_t part_num, bool truncate, ds3_part_t **ds3p, ds3_t *ds3)
int ds3_part_write(void *buf, daos_off_t off, daos_size_t *size, ds3_part_t *ds3p, ds3_t *ds3, daos_event_t *ev)
int ds3_fini()
int ds3_user_set(const char *name, struct ds3_user_info *info, struct ds3_user_info *old_info, ds3_t *ds3, daos_event_t *ev)
int ds3_init()
int ds3_part_close(ds3_part_t *ds3p)
int ds3_bucket_list_multipart(const char *bucket_name, uint32_t *nmp, struct ds3_multipart_upload_info *mps, uint32_t *ncp, struct ds3_common_prefix_info *cps, const char *prefix, const char *delim, char *marker, bool *is_truncated, ds3_t *ds3)
int ds3_obj_get_info(struct ds3_object_info *info, ds3_bucket_t *ds3b, ds3_obj_t *ds3o)
int ds3_upload_init(struct ds3_multipart_upload_info *info, const char *bucket_name, ds3_t *ds3)
int ds3_disconnect(ds3_t *ds3, daos_event_t *ev)
#define DS3_MAX_BUCKET_NAME
Definition daos_s3.h:26
int ds3_bucket_destroy(const char *name, bool force, ds3_t *ds3, daos_event_t *ev)
int ds3_obj_read(void *buf, daos_off_t off, daos_size_t *size, ds3_bucket_t *ds3b, ds3_obj_t *ds3o, daos_event_t *ev)
int ds3_obj_mark_latest(const char *key, ds3_bucket_t *ds3b)
int ds3_obj_close(ds3_obj_t *ds3o)
struct ds3_part ds3_part_t
Definition daos_s3.h:56
int ds3_obj_write(void *buf, daos_off_t off, daos_size_t *size, ds3_bucket_t *ds3b, ds3_obj_t *ds3o, daos_event_t *ev)
struct ds3_obj ds3_obj_t
Definition daos_s3.h:53
int ds3_upload_remove(const char *bucket_name, const char *upload_id, ds3_t *ds3)
struct ds3 ds3_t
Definition daos_s3.h:47
int ds3_obj_create(const char *key, ds3_obj_t **ds3o, ds3_bucket_t *ds3b)
#define DS3_MAX_KEY_BUFF
Definition daos_s3.h:32
int ds3_upload_list_parts(const char *bucket_name, const char *upload_id, uint32_t *npart, struct ds3_multipart_part_info *parts, uint32_t *marker, bool *is_truncated, ds3_t *ds3)
int ds3_connect(const char *pool, const char *sys, ds3_t **ds3, daos_event_t *ev)
int ds3_obj_set_info(struct ds3_object_info *info, ds3_bucket_t *ds3b, ds3_obj_t *ds3o)
int ds3_bucket_get_info(struct ds3_bucket_info *info, ds3_bucket_t *ds3b, daos_event_t *ev)
int ds3_user_get(const char *name, struct ds3_user_info *info, ds3_t *ds3, daos_event_t *ev)
int ds3_bucket_list_obj(uint32_t *nobj, struct ds3_object_info *objs, uint32_t *ncp, struct ds3_common_prefix_info *cps, const char *prefix, const char *delim, char *marker, bool list_versions, bool *is_truncated, ds3_bucket_t *ds3b)
struct ds3_bucket ds3_bucket_t
Definition daos_s3.h:50
int ds3_bucket_list(daos_size_t *nbuck, struct ds3_bucket_info *buf, char *marker, bool *is_truncated, ds3_t *ds3, daos_event_t *ev)
int ds3_part_read(void *buf, daos_off_t off, daos_size_t *size, ds3_part_t *ds3p, ds3_t *ds3, daos_event_t *ev)
int ds3_user_remove(const char *name, struct ds3_user_info *info, ds3_t *ds3, daos_event_t *ev)
int ds3_part_set_info(struct ds3_multipart_part_info *info, ds3_part_t *ds3p, ds3_t *ds3, daos_event_t *ev)
int ds3_obj_destroy(const char *key, ds3_bucket_t *ds3b)
#define DS3_MAX_UPLOAD_ID
Definition daos_s3.h:38
void * encoded
Definition daos_s3.h:79
size_t encoded_length
Definition daos_s3.h:81
char name[DS3_MAX_BUCKET_NAME]
Definition daos_s3.h:77
char prefix[DS3_MAX_KEY_BUFF]
Definition daos_s3.h:97
char key[DS3_MAX_KEY_BUFF]
Definition daos_s3.h:105
char upload_id[DS3_MAX_UPLOAD_ID]
Definition daos_s3.h:103
void * encoded
Definition daos_s3.h:89
char key[DS3_MAX_KEY_BUFF]
Definition daos_s3.h:87
size_t encoded_length
Definition daos_s3.h:91
const size_t access_ids_nr
Definition daos_s3.h:67
void * encoded
Definition daos_s3.h:69
const char * email
Definition daos_s3.h:63
size_t encoded_length
Definition daos_s3.h:71
const char * name
Definition daos_s3.h:61
const char ** access_ids
Definition daos_s3.h:65