Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 107 additions & 54 deletions src/content/docs/workers/wrangler/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,57 @@ wrangler r2 bucket list

<Render file="wrangler-commands/global-flags" product="workers" />

### `cors set`

Set the [CORS configuration](/r2/buckets/cors/) for an R2 bucket from a JSON file.

```txt
wrangler r2 bucket cors set <NAME> [OPTIONS]
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to set the CORS configuration for.
- `--file` <Type text="string" /> <MetaInfo text="required" />
- Path to the JSON file containing CORS configuration (file must be in format of request body of [put bucket CORS policy API](/api/operations/r2-put-bucket-cors-policy)).
- `--jurisdiction` <Type text="string" /> <MetaInfo text="optional" />
- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to [jurisdictional restrictions](/r2/reference/data-location/#jurisdictional-restrictions).
- `--force` <Type text="boolean" /> <MetaInfo text="optional" />
- Skip confirmation when setting CORS configuration.

<Render file="wrangler-commands/global-flags" product="workers" />

### `cors delete`

Clear the [CORS configuration](/r2/buckets/cors/) for an R2 bucket.

```txt
wrangler r2 bucket cors delete <NAME> [OPTIONS]
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to delete the CORS configuration for.
- `--jurisdiction` <Type text="string" /> <MetaInfo text="optional" />
- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to [jurisdictional restrictions](/r2/reference/data-location/#jurisdictional-restrictions).
- `--force` <Type text="boolean" /> <MetaInfo text="optional" />
- Skip confirmation when clearing the CORS configuration.

<Render file="wrangler-commands/global-flags" product="workers" />

### `cors list`

List the [CORS configuration](/r2/buckets/cors/) rules for an R2 bucket.

```txt
wrangler r2 bucket cors list <NAME> [OPTIONS]
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to list the CORS rules for.
- `--jurisdiction` <Type text="string" /> <MetaInfo text="optional" />
- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to [jurisdictional restrictions](/r2/reference/data-location/#jurisdictional-restrictions).

<Render file="wrangler-commands/global-flags" product="workers" />

### `dev-url enable`

Enable public access via the [r2.dev URL](/r2/buckets/public-buckets/#enable-managed-public-access) for an R2 bucket.
Expand Down Expand Up @@ -1137,59 +1188,6 @@ wrangler r2 bucket domain list <NAME> [OPTIONS]

<Render file="wrangler-commands/global-flags" product="workers" />

### `notification create`

Create an [event notification](/r2/buckets/event-notifications/) rule for an R2 bucket.

```txt
wrangler r2 bucket notification create <NAME> [OPTIONS]
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to create an event notification rule for.
- `--event-type` <Type text="'object-create'|'object-delete'[]" /> <MetaInfo text="required" />
- The [type of event(s)](/r2/buckets/event-notifications/#event-types) that will trigger event notifications.
- `--queue` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue that will receive event notification messages.
- `--prefix` <Type text="string" /> <MetaInfo text="optional" />
- The prefix that an object must match to emit event notifications (note: regular expressions are not supported).
- `--suffix` <Type text="string" /> <MetaInfo text="optional" />
- The suffix that an object must match to emit event notifications (note: regular expressions are not supported).
- `--description` <Type text="string" /> <MetaInfo text="optional" />
- A description that can be used to identify the event notification rule after creation.

<Render file="wrangler-commands/global-flags" product="workers" />

### `notification delete`

Remove an event notification rule from a bucket's [event notification](/r2/buckets/event-notifications/) configuration.

```txt
wrangler r2 bucket notification delete <NAME> [OPTIONS]
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to delete an event notification rule for.
- `--queue` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue that corresponds to the event notification rule. If no `rule` is provided, all event notification rules associated with the queue will be deleted.
- `--rule` <Type text="string" /> <MetaInfo text="optional" />
- The ID of the event notification rule to delete.

<Render file="wrangler-commands/global-flags" product="workers" />

### `notification list`

List the [event notification](/r2/buckets/event-notifications/) rules for a bucket.

```txt
wrangler r2 bucket notification list <NAME>
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to get event notification rules for.

<Render file="wrangler-commands/global-flags" product="workers" />

### `lifecycle add`

Add an [object lifecycle](/r2/buckets/object-lifecycles/) rule to an R2 bucket.
Expand Down Expand Up @@ -1267,6 +1265,61 @@ wrangler r2 bucket lifecycle set <NAME> [OPTIONS]
- Path to the JSON file containing lifecycle configuration (file must be in format of request body of [put object lifecycle configuration API](/api/operations/r2-put-bucket-lifecycle-configuration)).
- `--jurisdiction` <Type text="string" /> <MetaInfo text="optional" />
- The jurisdiction where the bucket exists, if a jurisdiction has been specified. Refer to [jurisdictional restrictions](/r2/reference/data-location/#jurisdictional-restrictions).
- `--force` <Type text="boolean" /> <MetaInfo text="optional" />
- Skip confirmation when setting object lifecycle configuration.

<Render file="wrangler-commands/global-flags" product="workers" />

### `notification create`

Create an [event notification](/r2/buckets/event-notifications/) rule for an R2 bucket.

```txt
wrangler r2 bucket notification create <NAME> [OPTIONS]
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to create an event notification rule for.
- `--event-type` <Type text="'object-create'|'object-delete'[]" /> <MetaInfo text="required" />
- The [type of event(s)](/r2/buckets/event-notifications/#event-types) that will trigger event notifications.
- `--queue` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue that will receive event notification messages.
- `--prefix` <Type text="string" /> <MetaInfo text="optional" />
- The prefix that an object must match to emit event notifications (note: regular expressions are not supported).
- `--suffix` <Type text="string" /> <MetaInfo text="optional" />
- The suffix that an object must match to emit event notifications (note: regular expressions are not supported).
- `--description` <Type text="string" /> <MetaInfo text="optional" />
- A description that can be used to identify the event notification rule after creation.

<Render file="wrangler-commands/global-flags" product="workers" />

### `notification delete`

Remove an event notification rule from a bucket's [event notification](/r2/buckets/event-notifications/) configuration.

```txt
wrangler r2 bucket notification delete <NAME> [OPTIONS]
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to delete an event notification rule for.
- `--queue` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue that corresponds to the event notification rule. If no `rule` is provided, all event notification rules associated with the queue will be deleted.
- `--rule` <Type text="string" /> <MetaInfo text="optional" />
- The ID of the event notification rule to delete.

<Render file="wrangler-commands/global-flags" product="workers" />

### `notification list`

List the [event notification](/r2/buckets/event-notifications/) rules for a bucket.

```txt
wrangler r2 bucket notification list <NAME>
```

- `NAME` <Type text="string" /> <MetaInfo text="required" />
- The name of the R2 bucket to get event notification rules for.

<Render file="wrangler-commands/global-flags" product="workers" />

Expand Down Expand Up @@ -2063,7 +2116,7 @@ wrangler queues info <name>
```

- `name` <Type text="string" /> <MetaInfo text="required" />
- The name of the queue to inspect.
- The name of the queue to inspect.

### `consumer`

Expand Down
Loading