## Get Bucket `client.R2.Buckets.Get(ctx, bucketName, params) (*Bucket, error)` **get** `/accounts/{account_id}/r2/buckets/{bucket_name}` Gets properties of an existing R2 bucket. ### Parameters - `bucketName string` Name of the bucket. - `params BucketGetParams` - `AccountID param.Field[string]` Path param: Account ID. - `Jurisdiction param.Field[BucketGetParamsCfR2Jurisdiction]` Header param: Jurisdiction where objects in this bucket are guaranteed to be stored. - `const BucketGetParamsCfR2JurisdictionDefault BucketGetParamsCfR2Jurisdiction = "default"` - `const BucketGetParamsCfR2JurisdictionEu BucketGetParamsCfR2Jurisdiction = "eu"` - `const BucketGetParamsCfR2JurisdictionFedramp BucketGetParamsCfR2Jurisdiction = "fedramp"` ### Returns - `type Bucket struct{…}` A single R2 bucket. - `CreationDate string` Creation timestamp. - `Jurisdiction BucketJurisdiction` Jurisdiction where objects in this bucket are guaranteed to be stored. - `const BucketJurisdictionDefault BucketJurisdiction = "default"` - `const BucketJurisdictionEu BucketJurisdiction = "eu"` - `const BucketJurisdictionFedramp BucketJurisdiction = "fedramp"` - `Location BucketLocation` Location of the bucket. - `const BucketLocationApac BucketLocation = "apac"` - `const BucketLocationEeur BucketLocation = "eeur"` - `const BucketLocationEnam BucketLocation = "enam"` - `const BucketLocationWeur BucketLocation = "weur"` - `const BucketLocationWnam BucketLocation = "wnam"` - `const BucketLocationOc BucketLocation = "oc"` - `Name string` Name of the bucket. - `StorageClass BucketStorageClass` Storage class for newly uploaded objects, unless specified otherwise. - `const BucketStorageClassStandard BucketStorageClass = "Standard"` - `const BucketStorageClassInfrequentAccess BucketStorageClass = "InfrequentAccess"` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/r2" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) bucket, err := client.R2.Buckets.Get( context.TODO(), "example-bucket", r2.BucketGetParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", bucket.CreationDate) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ "string" ], "result": { "creation_date": "creation_date", "jurisdiction": "default", "location": "apac", "name": "example-bucket", "storage_class": "Standard" }, "success": true } ```