Skip to content

Commit

Permalink
Add globus storage search_for
Browse files Browse the repository at this point in the history
  • Loading branch information
frthjf committed Mar 19, 2024
1 parent e257d5a commit 4932e3b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/examples/globus-storage/globus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, List

import os
import time
Expand Down Expand Up @@ -211,3 +211,16 @@ def local_path(self, *append):

def remote_path(self, *append):
return os.path.join(self.config.remote_endpoint_directory, *append)

def search_for(self, experiment) -> List[str]:
response = self.transfer_client.operation_ls(
self.config.remote_endpoint_id,
path=self.remote_path(),
show_hidden=True,
)
found = []
for item in response:
if experiment.hash in item["name"]:
found.append(item["name"])

return found

0 comments on commit 4932e3b

Please sign in to comment.