Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unused networks method is missed #691

Open
SergeyTsaplin opened this issue Feb 23, 2022 · 1 comment
Open

Delete unused networks method is missed #691

SergeyTsaplin opened this issue Feb 23, 2022 · 1 comment
Labels
sprint:pyconus2024 Issues marked for the sprint in PyCon US 2024

Comments

@SergeyTsaplin
Copy link

SergeyTsaplin commented Feb 23, 2022

Prune networks method is missed

Possible Implementation:

aiodocker/networks.py

class DockerNetworks:
    ...
    async def prune(self, *, filters: Mapping = None) -> List[str]:
        """
        Delete unused networks and return the list of the deleted networks.
        Args:
            filters: a dict with a list of filters
        Available filters:
            until=<timestamp> Prune networks created before this timestamp. The <timestamp> can be Unix timestamps, date formatted timestamps, or Go duration strings (e.g. 10m, 1h30m) computed relative to the daemon machine’s time.
            label (label=<key>, label=<key>=<value>, label!=<key>, or label!=<key>=<value>) Prune networks with (or without, in case label!=... is used) the specified labels.
        """
        data = {} if filters is None else {"filters": clean_filters(filters)}

        data = await self.docker._query_json("networks/prune",  method="POST", data=data)
        return data.get("NetworksDeleted") or []
@agusmakmun
Copy link

Other missing thing is to prune the volume as well.

@achimnol achimnol added the sprint:pyconus2024 Issues marked for the sprint in PyCon US 2024 label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sprint:pyconus2024 Issues marked for the sprint in PyCon US 2024
Projects
None yet
Development

No branches or pull requests

3 participants