DIRACGrid / diracx

The neXt DIRAC incarnation
GNU General Public License v3.0
9 stars 20 forks source link

Add support for uploading/downloading sandboxes #110

Closed chrisburr closed 1 year ago

chrisburr commented 1 year ago
from pathlib import Path
from diracx.client.aio import DiracClient
import diracx.api

async with DiracClient() as client:
    pfn = await diracx.api.jobs.create_sandbox(client, [Path("/tmp/recompress-part1.txt"), Path("/tmp/recompress-meta-part2.zip")])
    print(pfn)

destination = Path("/tmp/test")
async with DiracClient() as client:
    await diracx.api.jobs.download_sandbox(client, pfn, destination)
assert (destination / "recompress-part1.txt").is_file()
assert (destination / "recompress-meta-part2.zip").is_file()