cloudflare / cloudflare-docs

Cloudflare’s documentation
https://developers.cloudflare.com
Creative Commons Attribution 4.0 International
2.95k stars 3.7k forks source link

R2 putBucketLifecycleConfiguration sample code error - No value provided for input HTTP label: Bucket #8102

Closed kwj280 closed 3 weeks ago

kwj280 commented 1 year ago

Which Cloudflare product does this pertain to?

R2

Existing documentation URL(s)

https://developers.cloudflare.com/r2/buckets/object-lifecycles/

The documentation sample code gives Error: No value provided for input HTTP label: Bucket. error

Section that requires update

Configure the lifecycle policy for a bucket sample code

What needs to change?

await client
  .putBucketLifecycleConfiguration({
    LifecycleConfiguration: {
      Bucket: "testBucket",
      Rules: [

Bucket: "testBucket" should be under putBucketLifecycleConfiguration, not LifecycleConfiguration

How should it change?

await client
  .putBucketLifecycleConfiguration({
  Bucket: "testBucket",
    LifecycleConfiguration: {
      Rules: [

Additional information

I don't know if it's relevant, the bucket was created in Asia-Pacific region following this tutorial No response

kwj280 commented 1 year ago

After fixing the HTTP label: Bucket error, I was getting another error MalformedXML: The XML you provided was not well formed or did not validate against our published schema.

Setting Status: 'Enabled', option to each rule fixed the error