Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/cli/onefuzz/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,20 @@ def get(self, container: primitives.Container, filename: str) -> bytes:
downloaded = client.download_blob(filename)
return downloaded

def download(
self, container: primitives.Container, blob_name: str, file_path: Optional[str]
) -> "None":
"""download a container file to a local path"""
self.logger.debug("getting file from container: %s:%s", container, blob_name)
client = self._get_client(container)
downloaded = client.download_blob(blob_name)
local_file = file_path if file_path else blob_name
with open(local_file, "wb") as handle:
handle.write(downloaded)
self.logger.debug(
f"downloaded blob {blob_name} from container {container} to {local_file}"
)

def upload_file(
self,
container: primitives.Container,
Expand Down