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
32cd0161
Kaydet (Commit)
32cd0161
authored
Ara 02, 2016
tarafından
Joffrey F
Kaydeden (comit)
GitHub
Ara 02, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge pull request #1330 from docker/walkerlee-master
Add options to IPAMConfig
üst
fbc9f9b5
1d59aeca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
networks.py
docker/types/networks.py
+8
-1
api_network_test.py
tests/unit/api_network_test.py
+1
-1
No files found.
docker/types/networks.py
Dosyayı görüntüle @
32cd0161
...
@@ -50,6 +50,8 @@ class IPAMConfig(dict):
...
@@ -50,6 +50,8 @@ class IPAMConfig(dict):
driver (str): The IPAM driver to use. Defaults to ``default``.
driver (str): The IPAM driver to use. Defaults to ``default``.
pool_configs (list): A list of pool configurations
pool_configs (list): A list of pool configurations
(:py:class:`~docker.types.IPAMPool`). Defaults to empty list.
(:py:class:`~docker.types.IPAMPool`). Defaults to empty list.
options (dict): Driver options as a key-value dictionary.
Defaults to `None`.
Example:
Example:
...
@@ -57,12 +59,17 @@ class IPAMConfig(dict):
...
@@ -57,12 +59,17 @@ class IPAMConfig(dict):
>>> network = client.create_network('network1', ipam=ipam_config)
>>> network = client.create_network('network1', ipam=ipam_config)
"""
"""
def
__init__
(
self
,
driver
=
'default'
,
pool_configs
=
None
):
def
__init__
(
self
,
driver
=
'default'
,
pool_configs
=
None
,
options
=
None
):
self
.
update
({
self
.
update
({
'Driver'
:
driver
,
'Driver'
:
driver
,
'Config'
:
pool_configs
or
[]
'Config'
:
pool_configs
or
[]
})
})
if
options
:
if
not
isinstance
(
options
,
dict
):
raise
TypeError
(
'IPAMConfig options must be a dictionary'
)
self
[
'Options'
]
=
options
class
IPAMPool
(
dict
):
class
IPAMPool
(
dict
):
"""
"""
...
...
tests/unit/api_network_test.py
Dosyayı görüntüle @
32cd0161
...
@@ -100,7 +100,7 @@ class NetworkTest(BaseAPIClientTest):
...
@@ -100,7 +100,7 @@ class NetworkTest(BaseAPIClientTest):
"Gateway"
:
"192.168.52.254"
,
"Gateway"
:
"192.168.52.254"
,
"Subnet"
:
"192.168.52.0/24"
,
"Subnet"
:
"192.168.52.0/24"
,
"AuxiliaryAddresses"
:
None
,
"AuxiliaryAddresses"
:
None
,
}]
}]
,
}
}
})
})
...
...
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