Portainer icon

Portainer

Work with Portainer API data to manage Docker

Network → Delete

AI-generated

Overview

This node operation deletes a Docker network in a specified environment using the Portainer API. It is useful for managing Docker networks by removing unused or obsolete networks to maintain a clean and efficient Docker environment. For example, a user can delete a network by providing the environment ID and the network ID, optionally forcing the deletion even if the network is in use.

Use Case Examples

  1. Deleting a Docker network by specifying the environment ID and network ID.
  2. Force deleting a network that is currently in use to free up resources.

Properties

Name Meaning
Environment ID The ID of the environment/endpoint in Portainer where the network exists.
Network ID The ID of the network to be deleted.
Force Delete Whether to force deletion even if the network is currently in use.

Output

JSON

  • body - The response body from the Portainer API after attempting to delete the network, typically indicating success or failure.

Dependencies

  • Portainer API with an API key credential for authentication.

Troubleshooting

  • Ensure the environment ID and network ID are correct and exist in Portainer.
  • If force delete is false and the network is in use, deletion will fail; set force delete to true to override.
  • Check API key and base URL credentials for proper authentication and connectivity.
  • Timeouts or SSL issues may occur; configure request options accordingly.

Links

Discussion