Export the contents of a filesystem as a tar archive. Args: container (str): The container to export chunk_size (int): The number of bytes returned by each iteration of the generator. If ``None``, data will be streamed as it is
(self, container, chunk_size=DEFAULT_DATA_CHUNK_SIZE)
| 700 | |
| 701 | @utils.check_resource('container') |
| 702 | def export(self, container, chunk_size=DEFAULT_DATA_CHUNK_SIZE): |
| 703 | """ |
| 704 | Export the contents of a filesystem as a tar archive. |
| 705 | |
| 706 | Args: |
| 707 | container (str): The container to export |
| 708 | chunk_size (int): The number of bytes returned by each iteration |
| 709 | of the generator. If ``None``, data will be streamed as it is |
| 710 | received. Default: 2 MB |
| 711 | |
| 712 | Returns: |
| 713 | (generator): The archived filesystem data stream |
| 714 | |
| 715 | Raises: |
| 716 | :py:class:`docker.errors.APIError` |
| 717 | If the server returns an error. |
| 718 | """ |
| 719 | res = self._get( |
| 720 | self._url("/containers/{0}/export", container), stream=True |
| 721 | ) |
| 722 | return self._stream_raw_result(res, chunk_size, False) |
| 723 | |
| 724 | @utils.check_resource('container') |
| 725 | def get_archive(self, container, path, chunk_size=DEFAULT_DATA_CHUNK_SIZE, |
nothing calls this directly
no test coverage detected