0

我正在尝试为我的存储桶设置一个新的到期日期,但是我很难将规则添加到存储桶中。这就是我得到的:

    S3BucketLifecycleConfigurationRule *testRule = [[S3BucketLifecycleConfigurationRule alloc] initWithId:@"My Rule" andPrefix:self.newRuleTextField.text andExpirationInDays:1 andStatus:@"ENABLE"];

在此之后我知道我需要将此规则添加到 S3BucketLifecycleConfiguration 实例,以便我最终可以调用请求方法,但我不知道如何将其添加到 S3BucketLifecycleConfiguration

    S3SetBucketLifecycleConfigurationRequest *setBucketLifecycleConfigurationRequest = [[S3SetBucketLifecycleConfigurationRequest alloc] initWithBucketName:self.bucketName withConfiguration:myConfig;

提前谢谢你们

4

1 回答 1

1

S3BucketLifecycleConfiguration有一个名为的属性rules,其中包含S3BucketLifecycleConfigurationRules 的列表。以下应该有效:

S3BucketLifecycleConfiguration *myConfig = [S3BucketLifecycleConfiguration new];
myConfig.rules = [NSArray arrayWithObject:testRule];
于 2013-02-04T20:00:37.367 回答