@@ -42,7 +42,7 @@ def tasks(self, filters=None):
42
42
``label``, and ``desired-state``.
43
43
44
44
Returns:
45
- ( :py:class:`list`) : List of task dictionaries.
45
+ :py:class:`list`: List of task dictionaries.
46
46
47
47
Raises:
48
48
:py:class:`docker.errors.APIError`
@@ -84,26 +84,27 @@ def update(self, **kwargs):
84
84
85
85
def logs (self , ** kwargs ):
86
86
"""
87
- Get log stream for the service.
88
- Note: This method works only for services with the ``json-file``
89
- or ``journald`` logging drivers.
90
-
91
- Args:
92
- details (bool): Show extra details provided to logs.
93
- Default: ``False``
94
- follow (bool): Keep connection open to read logs as they are
95
- sent by the Engine. Default: ``False``
96
- stdout (bool): Return logs from ``stdout``. Default: ``False``
97
- stderr (bool): Return logs from ``stderr``. Default: ``False``
98
- since (int): UNIX timestamp for the logs staring point.
99
- Default: 0
100
- timestamps (bool): Add timestamps to every log line.
101
- tail (string or int): Number of log lines to be returned,
102
- counting from the current end of the logs. Specify an
103
- integer or ``'all'`` to output all log lines.
104
- Default: ``all``
105
-
106
- Returns (generator): Logs for the service.
87
+ Get log stream for the service.
88
+ Note: This method works only for services with the ``json-file``
89
+ or ``journald`` logging drivers.
90
+
91
+ Args:
92
+ details (bool): Show extra details provided to logs.
93
+ Default: ``False``
94
+ follow (bool): Keep connection open to read logs as they are
95
+ sent by the Engine. Default: ``False``
96
+ stdout (bool): Return logs from ``stdout``. Default: ``False``
97
+ stderr (bool): Return logs from ``stderr``. Default: ``False``
98
+ since (int): UNIX timestamp for the logs staring point.
99
+ Default: 0
100
+ timestamps (bool): Add timestamps to every log line.
101
+ tail (string or int): Number of log lines to be returned,
102
+ counting from the current end of the logs. Specify an
103
+ integer or ``'all'`` to output all log lines.
104
+ Default: ``all``
105
+
106
+ Returns:
107
+ generator: Logs for the service.
107
108
"""
108
109
is_tty = self .attrs ['Spec' ]['TaskTemplate' ]['ContainerSpec' ].get (
109
110
'TTY' , False
@@ -118,7 +119,7 @@ def scale(self, replicas):
118
119
replicas (int): The number of containers that should be running.
119
120
120
121
Returns:
121
- ``True``if successful.
122
+ bool: ``True`` if successful.
122
123
"""
123
124
124
125
if 'Global' in self .attrs ['Spec' ]['Mode' ].keys ():
@@ -134,7 +135,7 @@ def force_update(self):
134
135
Force update the service even if no changes require it.
135
136
136
137
Returns:
137
- ``True``if successful.
138
+ bool: ``True`` if successful.
138
139
"""
139
140
140
141
return self .update (force_update = True , fetch_current_spec = True )
@@ -206,7 +207,7 @@ def create(self, image, command=None, **kwargs):
206
207
containers.
207
208
208
209
Returns:
209
- ( :py:class:`Service`) The created service.
210
+ :py:class:`Service`: The created service.
210
211
211
212
Raises:
212
213
:py:class:`docker.errors.APIError`
@@ -228,7 +229,7 @@ def get(self, service_id, insert_defaults=None):
228
229
into the output.
229
230
230
231
Returns:
231
- ( :py:class:`Service`) : The service.
232
+ :py:class:`Service`: The service.
232
233
233
234
Raises:
234
235
:py:class:`docker.errors.NotFound`
@@ -253,7 +254,7 @@ def list(self, **kwargs):
253
254
Default: ``None``.
254
255
255
256
Returns:
256
- ( list of :py:class:`Service`) : The services.
257
+ list of :py:class:`Service`: The services.
257
258
258
259
Raises:
259
260
:py:class:`docker.errors.APIError`
0 commit comments