{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Replaces the lock rules for an R2 bucket. Enabled rules prevent matching objects from being overwritten or deleted for a duration, until a date, or indefinitely. Rules apply to existing and newly uploaded objects.","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_bucket-lock-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_bucket-lock-rule":{"type":"object","properties":{"condition":{"oneOf":[{"$ref":"#/definitions/r2_lock-rule-age-condition"},{"$ref":"#/definitions/r2_lock-rule-date-condition"},{"$ref":"#/definitions/r2_lock-rule-indefinite-condition"}]},"enabled":{"description":"Whether or not this rule is in effect.","type":"boolean"},"id":{"description":"Unique identifier for this rule.","type":"string","examples":["Lock all objects for 24 hours"]},"prefix":{"description":"Rule 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":["id","condition","enabled"]},"r2_lock-rule-age-condition":{"description":"Condition to apply a lock rule to an object for how long in seconds.","type":"object","properties":{"maxAgeSeconds":{"type":"integer","examples":[100]},"type":{"type":"string","enum":["Age"]}},"required":["type","maxAgeSeconds"]},"r2_lock-rule-date-condition":{"description":"Condition to apply a lock rule to an object until a specific date.","type":"object","properties":{"date":{"type":"string","format":"date-time"},"type":{"type":"string","enum":["Date"]}},"required":["type","date"]},"r2_lock-rule-indefinite-condition":{"description":"Condition to apply a lock rule indefinitely.","type":"object","properties":{"type":{"type":"string","enum":["Indefinite"]}},"required":["type"]}}},"name":"Set Bucket Lock Rules","id":"cloudflare.r2-put-bucket-lock-configuration","example":{"path":{"bucket_name":"example-bucket","account_id":"023e105f4ecef8ad9ca31a8372d0c353"},"body":{}},"maxRequests":1,"summary":false}}