List Buckets
Updated at:2025-11-03
List buckets
The following code can list all buckets of a user:
C
1void test_get_service(bos_pool_t *p, bos_request_options_t *options, bos_string_t bucket)
2{
3 bos_status_t *s = NULL;
4 bos_get_service_params_t *list_params = NULL;
5 bos_table_t *resp_headers = NULL;
6 json_t *root;
7 list_params = bos_create_get_service_params(options->pool);
8 s = bos_get_service(options, &root,list_params, &resp_headers);
9 log_status(s);
10 bos_pool_destroy(p);
11 char* jsonString = json_dumps(root, JSON_INDENT(2));
12 printf("\n%s\n", jsonString);
13}
