mirror of https://github.com/docker/docker-py.git
Fix endpoint spec and networks params in update_service
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
be2ae8df36
commit
3ac73a285b
|
@ -83,7 +83,16 @@ class ServiceApiMixin(object):
|
|||
@utils.check_resource
|
||||
def update_service(self, service, version, task_template=None, name=None,
|
||||
labels=None, mode=None, update_config=None,
|
||||
networks=None, endpoint_config=None):
|
||||
networks=None, endpoint_config=None,
|
||||
endpoint_spec=None):
|
||||
|
||||
if endpoint_config is not None:
|
||||
warnings.warn(
|
||||
'endpoint_config has been renamed to endpoint_spec.',
|
||||
DeprecationWarning
|
||||
)
|
||||
endpoint_spec = endpoint_config
|
||||
|
||||
url = self._url('/services/{0}/update', service)
|
||||
data = {}
|
||||
headers = {}
|
||||
|
@ -104,9 +113,9 @@ class ServiceApiMixin(object):
|
|||
if update_config is not None:
|
||||
data['UpdateConfig'] = update_config
|
||||
if networks is not None:
|
||||
data['Networks'] = networks
|
||||
if endpoint_config is not None:
|
||||
data['Endpoint'] = endpoint_config
|
||||
data['Networks'] = utils.convert_service_networks(networks)
|
||||
if endpoint_spec is not None:
|
||||
data['EndpointSpec'] = endpoint_spec
|
||||
|
||||
resp = self._post_json(
|
||||
url, data=data, params={'version': version}, headers=headers
|
||||
|
|
|
@ -137,7 +137,7 @@ Update a service.
|
|||
See the [UpdateConfig class](#UpdateConfig) for details. Default: `None`.
|
||||
* networks (list): List of network names or IDs to attach the service to.
|
||||
Default: `None`.
|
||||
* endpoint_config (dict): Properties that can be configured to access and load
|
||||
* endpoint_spec (dict): Properties that can be configured to access and load
|
||||
balance a service. Default: `None`.
|
||||
|
||||
**Returns:** `True` if successful. Raises an `APIError` otherwise.
|
||||
|
|
Loading…
Reference in New Issue