Scale service container. Args: replicas (int): The number of containers that should be running. Returns: bool: ``True`` if successful.
(self, replicas)
| 114 | return self.client.api.service_logs(self.id, is_tty=is_tty, **kwargs) |
| 115 | |
| 116 | def scale(self, replicas): |
| 117 | """ |
| 118 | Scale service container. |
| 119 | |
| 120 | Args: |
| 121 | replicas (int): The number of containers that should be running. |
| 122 | |
| 123 | Returns: |
| 124 | bool: ``True`` if successful. |
| 125 | """ |
| 126 | |
| 127 | if 'Global' in self.attrs['Spec']['Mode'].keys(): |
| 128 | raise InvalidArgument('Cannot scale a global container') |
| 129 | |
| 130 | service_mode = ServiceMode('replicated', replicas) |
| 131 | return self.client.api.update_service(self.id, self.version, |
| 132 | mode=service_mode, |
| 133 | fetch_current_spec=True) |
| 134 | |
| 135 | def force_update(self): |
| 136 | """ |