-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
docker.networks
documentation (#828)
Co-authored-by: Joongi Kim <[email protected]>
- Loading branch information
1 parent
71c61b6
commit 0507328
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |