Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
2b85fbf1
Kaydet (Commit)
2b85fbf1
authored
Ara 05, 2016
tarafından
Daniel Nephin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add attachable.
Signed-off-by:
Daniel Nephin
<
dnephin@gmail.com
>
üst
dd8ad21c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
network.py
docker/api/network.py
+11
-2
api_network_test.py
tests/unit/api_network_test.py
+4
-0
No files found.
docker/api/network.py
Dosyayı görüntüle @
2b85fbf1
...
...
@@ -38,7 +38,7 @@ class NetworkApiMixin(object):
@minimum_version
(
'1.21'
)
def
create_network
(
self
,
name
,
driver
=
None
,
options
=
None
,
ipam
=
None
,
check_duplicate
=
None
,
internal
=
False
,
labels
=
None
,
enable_ipv6
=
False
):
enable_ipv6
=
False
,
attachable
=
None
):
"""
Create a network. Similar to the ``docker network create``.
...
...
@@ -54,6 +54,9 @@ class NetworkApiMixin(object):
labels (dict): Map of labels to set on the network. Default
``None``.
enable_ipv6 (bool): Enable IPv6 on the network. Default ``False``.
attachable (bool): If enabled, and the network is in the global
scope, non-service containers on worker nodes will be able to
connect to the network.
Returns:
(dict): The created network reference object
...
...
@@ -91,7 +94,7 @@ class NetworkApiMixin(object):
'Driver'
:
driver
,
'Options'
:
options
,
'IPAM'
:
ipam
,
'CheckDuplicate'
:
check_duplicate
'CheckDuplicate'
:
check_duplicate
,
}
if
labels
is
not
None
:
...
...
@@ -116,6 +119,12 @@ class NetworkApiMixin(object):
'supported in API version < 1.22'
)
data
[
'Internal'
]
=
True
if
attachable
is
not
None
if
version_lt
(
self
.
_version
,
'1.24'
):
raise
InvalidVersion
(
'Attachable is not '
'supported in API version < 1.24'
)
data
[
'Attachable'
]
=
attachable
url
=
self
.
_url
(
"/networks/create"
)
res
=
self
.
_post_json
(
url
,
data
=
data
)
return
self
.
_result
(
res
,
json
=
True
)
...
...
tests/unit/api_network_test.py
Dosyayı görüntüle @
2b85fbf1
...
...
@@ -104,6 +104,10 @@ class NetworkTest(BaseAPIClientTest):
}
})
@requires_api_version
(
'1.24'
)
def
test_create_network_with_attachable
(
self
):
pass
@requires_api_version
(
'1.21'
)
def
test_remove_network
(
self
):
network_id
=
'abc12345'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment