{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Replaces the object lifecycle rules for an R2 bucket. Rules match object-key prefixes and can expire objects, abort incomplete multipart uploads, or transition objects to Infrequent Access storage.","properties":{"path":{"type":"object","properties":{"bucket_name":{"$ref":"#/definitions/r2_bucket_name"},"account_id":{"$ref":"#/definitions/r2_account_identifier"}},"required":["bucket_name","account_id"],"additionalProperties":false},"headers":{"type":"object","properties":{"cf-r2-jurisdiction":{"type":"string","default":"default","enum":["default","eu","us","fedramp","fedramp-high"],"description":"Jurisdiction where objects in this bucket are guaranteed to be stored."}},"required":[],"additionalProperties":false},"body":{"type":"object","properties":{"rules":{"type":"array","items":{"$ref":"#/definitions/r2_lifecycle-rule"}}}}},"required":["path","body"],"additionalProperties":false,"definitions":{"r2_bucket_name":{"description":"Name of the bucket.","type":"string","maxLength":64,"minLength":3,"pattern":"^[a-z0-9][a-z0-9-]*[a-z0-9]","examples":["example-bucket"]},"r2_account_identifier":{"description":"Cloudflare account ID that owns the R2 resource.","type":"string","maxLength":32,"examples":["023e105f4ecef8ad9ca31a8372d0c353"]},"r2_lifecycle-rule":{"type":"object","properties":{"abortMultipartUploadsTransition":{"description":"Transition to abort ongoing multipart uploads.","type":"object","properties":{"condition":{"allOf":[{"$ref":"#/definitions/r2_lifecycle-age-condition"}]}}},"conditions":{"description":"Conditions that apply to all transitions of this rule.","type":"object","properties":{"prefix":{"description":"Transitions will only apply to objects/uploads in the bucket that start with the given prefix, an empty prefix can be provided to scope rule to all objects/uploads.","type":"string"}},"required":["prefix"]},"deleteObjectsTransition":{"description":"Transition to delete objects.","type":"object","properties":{"condition":{"oneOf":[{"$ref":"#/definitions/r2_lifecycle-age-condition"},{"$ref":"#/definitions/r2_lifecycle-date-condition"}]}}},"enabled":{"description":"Whether or not this rule is in effect.","type":"boolean"},"id":{"description":"Unique identifier for this rule.","type":"string","examples":["Expire all objects older than 24 hours"]},"storageClassTransitions":{"description":"Transitions to change the storage class of objects.","type":"array","items":{"allOf":[{"$ref":"#/definitions/r2_lifecycle-storage-transition"}]}}},"required":["id","conditions","enabled"]},"r2_lifecycle-age-condition":{"description":"Condition for lifecycle transitions to apply after an object reaches an age in seconds.","type":"object","properties":{"maxAge":{"type":"integer"},"type":{"type":"string","enum":["Age"]}},"required":["type","maxAge"]},"r2_lifecycle-date-condition":{"description":"Condition for lifecycle transitions to apply on a specific date.","type":"object","properties":{"date":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Date"]}},"required":["type","date"]},"r2_lifecycle-storage-transition":{"type":"object","properties":{"condition":{"oneOf":[{"$ref":"#/definitions/r2_lifecycle-age-condition"},{"$ref":"#/definitions/r2_lifecycle-date-condition"}]},"storageClass":{"type":"string","enum":["InfrequentAccess"]}},"required":["condition","storageClass"]}}},"name":"Set Object Lifecycle Rules","id":"cloudflare.r2-put-bucket-lifecycle-configuration","example":{"path":{"bucket_name":"example-bucket","account_id":"023e105f4ecef8ad9ca31a8372d0c353"},"body":{}},"maxRequests":1,"summary":false}}