MCPcopy
hub / github.com/cortexlabs/cortex / SetLifecycleRules

Method SetLifecycleRules

pkg/lib/aws/s3.go:939–952  ·  view source on GitHub ↗
(bucket string, rules []s3.LifecycleRule)

Source from the content-addressed store, hash-verified

937}
938
939func (c *Client) SetLifecycleRules(bucket string, rules []s3.LifecycleRule) error {
940 pointerRules := []*s3.LifecycleRule{}
941 for i := range rules {
942 pointerRules = append(pointerRules, &rules[i])
943 }
944 _, err := c.S3().PutBucketLifecycleConfiguration(&s3.PutBucketLifecycleConfigurationInput{
945 Bucket: pointer.String(bucket),
946 LifecycleConfiguration: &s3.BucketLifecycleConfiguration{
947 Rules: pointerRules,
948 },
949 })
950
951 return errors.WithStack(err)
952}
953
954func (c *Client) GetLifecycleRules(bucket string) ([]s3.LifecycleRule, error) {
955 lifecycleOutput, err := c.S3().GetBucketLifecycleConfiguration(&s3.GetBucketLifecycleConfigurationInput{

Callers 2

Calls 3

S3Method · 0.95
StringFunction · 0.92
WithStackFunction · 0.92

Tested by

no test coverage detected