获取桶列表

Bucket是用于存储对象(Object)的容器,所有的对象都必须隶属于某个Bucket。本文介绍如何获取桶(Bucket)列表。

接口定义:

- (void)listBuckets:(AWSRequest *)request
     completionHandler:(void (^)(AWSS3ListBucketsOutput *response, NSError *error))completionHandler

代码示例:

- (void) listBuckets {
    AWSRequest *request = [[AWSRequest alloc] init];
    [self.s3 listBuckets:request completionHandler:^(AWSS3ListBucketsOutput * _Nullable response, NSError * _Nullable error) {
        if (error != nil) {
            NSLog(@"error: %@", error);
            return;
        }
    }];
}