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
cfb14fa7
Kaydet (Commit)
cfb14fa7
authored
Şub 24, 2017
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add df method
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
f387ae46
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
6 deletions
+34
-6
daemon.py
docker/api/daemon.py
+16
-0
client.py
docker/client.py
+4
-0
client.rst
docs/client.rst
+1
-0
client_test.py
tests/integration/client_test.py
+13
-6
No files found.
docker/api/daemon.py
Dosyayı görüntüle @
cfb14fa7
...
...
@@ -7,6 +7,22 @@ from ..constants import INSECURE_REGISTRY_DEPRECATION_WARNING
class
DaemonApiMixin
(
object
):
@utils.minimum_version
(
'1.25'
)
def
df
(
self
):
"""
Get data usage information.
Returns:
(dict): A dictionary representing different resource categories
and their respective data usage.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.
"""
url
=
self
.
_url
(
'/system/df'
)
return
self
.
_result
(
self
.
_get
(
url
),
True
)
def
events
(
self
,
since
=
None
,
until
=
None
,
filters
=
None
,
decode
=
None
):
"""
Get real-time events from the server. Similar to the ``docker events``
...
...
docker/client.py
Dosyayı görüntüle @
cfb14fa7
...
...
@@ -155,6 +155,10 @@ class DockerClient(object):
return
self
.
api
.
events
(
*
args
,
**
kwargs
)
events
.
__doc__
=
APIClient
.
events
.
__doc__
def
df
(
self
):
return
self
.
api
.
df
()
df
.
__doc__
=
APIClient
.
df
.
__doc__
def
info
(
self
,
*
args
,
**
kwargs
):
return
self
.
api
.
info
(
*
args
,
**
kwargs
)
info
.
__doc__
=
APIClient
.
info
.
__doc__
...
...
docs/client.rst
Dosyayı görüntüle @
cfb14fa7
...
...
@@ -25,6 +25,7 @@ Client reference
.. autoattribute:: swarm
.. autoattribute:: volumes
.. automethod:: df()
.. automethod:: events()
.. automethod:: info()
.. automethod:: login()
...
...
tests/integration/client_test.py
Dosyayı görüntüle @
cfb14fa7
...
...
@@ -2,21 +2,28 @@ import unittest
import
docker
from
..helpers
import
requires_api_version
from
.base
import
TEST_API_VERSION
class
ClientTest
(
unittest
.
TestCase
):
client
=
docker
.
from_env
(
version
=
TEST_API_VERSION
)
def
test_info
(
self
):
client
=
docker
.
from_env
(
version
=
TEST_API_VERSION
)
info
=
client
.
info
()
info
=
self
.
client
.
info
()
assert
'ID'
in
info
assert
'Name'
in
info
def
test_ping
(
self
):
client
=
docker
.
from_env
(
version
=
TEST_API_VERSION
)
assert
client
.
ping
()
is
True
assert
self
.
client
.
ping
()
is
True
def
test_version
(
self
):
client
=
docker
.
from_env
(
version
=
TEST_API_VERSION
)
assert
'Version'
in
client
.
version
()
assert
'Version'
in
self
.
client
.
version
()
@requires_api_version
(
'1.25'
)
def
test_df
(
self
):
data
=
self
.
client
.
df
()
assert
'LayersSize'
in
data
assert
'Containers'
in
data
assert
'Volumes'
in
data
assert
'Images'
in
data
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