summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2018-09-14 16:58:11 -0700
committerJoffrey F <joffrey@docker.com>2018-09-14 16:58:11 -0700
commit2b10c3773c1f48d16d395f1f08a7a93419ab0790 (patch)
treef1c82750c16699e8715f08d71dcb990129361ab4
parent87352cd05729bdddb4e7cb2941047ec566f8f8b0 (diff)
downloaddocker-py-2b10c3773c1f48d16d395f1f08a7a93419ab0790.tar.gz
Fix docs for Service objects2133-services-docs
Signed-off-by: Joffrey F <joffrey@docker.com>
-rw-r--r--docker/models/services.py53
-rw-r--r--docs/services.rst3
2 files changed, 30 insertions, 26 deletions
diff --git a/docker/models/services.py b/docker/models/services.py
index fa029f3..a2a3ed0 100644
--- a/docker/models/services.py
+++ b/docker/models/services.py
@@ -42,7 +42,7 @@ class Service(Model):
``label``, and ``desired-state``.
Returns:
- (:py:class:`list`): List of task dictionaries.
+ :py:class:`list`: List of task dictionaries.
Raises:
:py:class:`docker.errors.APIError`
@@ -84,26 +84,27 @@ class Service(Model):
def logs(self, **kwargs):
"""
- Get log stream for the service.
- Note: This method works only for services with the ``json-file``
- or ``journald`` logging drivers.
-
- Args:
- details (bool): Show extra details provided to logs.
- Default: ``False``
- follow (bool): Keep connection open to read logs as they are
- sent by the Engine. Default: ``False``
- stdout (bool): Return logs from ``stdout``. Default: ``False``
- stderr (bool): Return logs from ``stderr``. Default: ``False``
- since (int): UNIX timestamp for the logs staring point.
- Default: 0
- timestamps (bool): Add timestamps to every log line.
- tail (string or int): Number of log lines to be returned,
- counting from the current end of the logs. Specify an
- integer or ``'all'`` to output all log lines.
- Default: ``all``
-
- Returns (generator): Logs for the service.
+ Get log stream for the service.
+ Note: This method works only for services with the ``json-file``
+ or ``journald`` logging drivers.
+
+ Args:
+ details (bool): Show extra details provided to logs.
+ Default: ``False``
+ follow (bool): Keep connection open to read logs as they are
+ sent by the Engine. Default: ``False``
+ stdout (bool): Return logs from ``stdout``. Default: ``False``
+ stderr (bool): Return logs from ``stderr``. Default: ``False``
+ since (int): UNIX timestamp for the logs staring point.
+ Default: 0
+ timestamps (bool): Add timestamps to every log line.
+ tail (string or int): Number of log lines to be returned,
+ counting from the current end of the logs. Specify an
+ integer or ``'all'`` to output all log lines.
+ Default: ``all``
+
+ Returns:
+ generator: Logs for the service.
"""
is_tty = self.attrs['Spec']['TaskTemplate']['ContainerSpec'].get(
'TTY', False
@@ -118,7 +119,7 @@ class Service(Model):
replicas (int): The number of containers that should be running.
Returns:
- ``True``if successful.
+ bool: ``True`` if successful.
"""
if 'Global' in self.attrs['Spec']['Mode'].keys():
@@ -134,7 +135,7 @@ class Service(Model):
Force update the service even if no changes require it.
Returns:
- ``True``if successful.
+ bool: ``True`` if successful.
"""
return self.update(force_update=True, fetch_current_spec=True)
@@ -206,7 +207,7 @@ class ServiceCollection(Collection):
containers.
Returns:
- (:py:class:`Service`) The created service.
+ :py:class:`Service`: The created service.
Raises:
:py:class:`docker.errors.APIError`
@@ -228,7 +229,7 @@ class ServiceCollection(Collection):
into the output.
Returns:
- (:py:class:`Service`): The service.
+ :py:class:`Service`: The service.
Raises:
:py:class:`docker.errors.NotFound`
@@ -253,7 +254,7 @@ class ServiceCollection(Collection):
Default: ``None``.
Returns:
- (list of :py:class:`Service`): The services.
+ list of :py:class:`Service`: The services.
Raises:
:py:class:`docker.errors.APIError`
diff --git a/docs/services.rst b/docs/services.rst
index d8e5285..8f44428 100644
--- a/docs/services.rst
+++ b/docs/services.rst
@@ -30,7 +30,10 @@ Service objects
The raw representation of this object from the server.
+ .. automethod:: force_update
+ .. automethod:: logs
.. automethod:: reload
.. automethod:: remove
+ .. automethod:: scale
.. automethod:: tasks
.. automethod:: update