'Update a service\'s configuration. Similar to the ``docker service
update`` command.
Takes the same parameters as :py:meth:`~ServiceCollection.create`.
Raises:
:py:class:`docker.errors.APIError`
If the server returns an error.'

def update(self, **kwargs):

    if ('image' not in kwargs):
        spec = self.attrs['Spec']['TaskTemplate']['ContainerSpec']
        kwargs['image'] = spec['Image']
    create_kwargs = _get_create_service_kwargs('update', kwargs)
    return self.client.api.update_service(self.id, self.version, **create_kwargs)
