Skip to content

Commit

Permalink
Add docker.networks documentation (#828)
Browse files Browse the repository at this point in the history
Co-authored-by: Joongi Kim <[email protected]>
  • Loading branch information
naufalafif and achimnol authored May 7, 2024
1 parent 71c61b6 commit 0507328
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/networks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
==========
Networks
==========

Create a network
==================

.. code-block:: python
import asyncio
import aiodocker
async def create_network():
docker = aiodocker.Docker()
network_config = {
"Name": "isolated_nw",
"Driver": "bridge",
"EnableIPv6": False,
"IPAM": {
"Driver": "default"
}
}
network = await docker.networks.create(config=network_config)
print(network)
await docker.close()
if __name__ == '__main__':
asyncio.run(create_network())
---------
Reference
---------

DockerNetworks
================
.. autoclass:: aiodocker.docker.DockerNetworks
:members:
:undoc-members:

DockerNetwork
===============
.. autoclass:: aiodocker.docker.DockerNetwork
:members:
:undoc-members:

0 comments on commit 0507328

Please sign in to comment.