doctl Verified current stable Not installed? Documentation

Doctl / Run Doctl Databases Firewalls Command With Access Token

Run Doctl Databases Firewalls Command With Access Token

Execute a firewall command for databases using an access token.

$
Terminal
doctl {d|databases} {fw|firewalls} {command} {-t|--access-token} {access_token}

When To Use

During critical updates to firewall rules where elevated access is required.

Pro Tip

Combining commands with `&&` can ensure sequential execution based on previous command success.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
$ doctl databases fw list -t my_access_token

ID              Name                Database ID      Created At
---------------------------------------------------------
1234567890     Allow SSH          9876543210      2023-10-01T12:00:00Z
0987654321     Allow HTTP         9876543210      2023-10-01T12:05:00Z

Anatomy of Output

Understanding the result

Command executed: fw list Executed Command

Summarizes the executed command details.

Firewall Rules: 5 Rule Count

Indicates total firewall rules applied.

Status: success Operation Status

Indicates successful execution.

Troubleshooting

Common pitfalls

Error: Invalid command specified.

Solution: Verify the command being used; refer to documentation.

Error: Access token is invalid.

Solution: Regenerate token if necessary.

Error: Database ID not found.

Solution: Ensure the provided database ID is correct.

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.

How To Run

Execution path

  1. Step 1

    Obtain your access token from the DigitalOcean dashboard.

  2. Step 2

    Run the command: doctl databases fw list -t your_access_token.

  3. Step 3

    Review the output for current firewall rules.

Alternative Approaches

Comparable commands in other tools

Alternative documentation tools for the same job.