列举bucket
更新时间:2024-04-09
列举Bucket
如下代码可以列出用户所有的Bucket:
void test_get_service(bos_pool_t *p, bos_request_options_t *options, bos_string_t bucket)
{
bos_status_t *s = NULL;
bos_get_service_params_t *list_params = NULL;
bos_table_t *resp_headers = NULL;
json_t *root;
list_params = bos_create_get_service_params(options->pool);
s = bos_get_service(options, &root,list_params, &resp_headers);
log_status(s);
bos_pool_destroy(p);
char* jsonString = json_dumps(root, JSON_INDENT(2));
printf("\n%s\n", jsonString);
}