Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GWDataFind Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IGWN Computing and Software
GWDataFind
GWDataFind Server
Commits
e7ac425c
Commit
e7ac425c
authored
1 year ago
by
Duncan Macleod
Committed by
Duncan Macleod
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
api: make URL transforms more generic
parent
9cd5af67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!64
Add support for OSDF URL transforms
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gwdatafind_server/api/v1.py
+13
-5
13 additions, 5 deletions
gwdatafind_server/api/v1.py
with
13 additions
and
5 deletions
gwdatafind_server/api/v1.py
+
13
−
5
View file @
e7ac425c
...
...
@@ -251,6 +251,11 @@ def find_latest_url(ext, site, tag, urltype=None):
# -- URL matcher --------------------------------------------------------------
URL_TRANSFORM
=
{
"
file
"
:
_file_url
,
"
gsiftp
"
:
_gsiftp_url
,
}
def
_get_latest_segment
(
seglist
,
duration
):
"""
Get segment for latest file of the given duration in a segment list
...
...
@@ -303,15 +308,18 @@ def _find_urls(
gps
+=
cdur
# convert paths to URLs for various schemes
urltypes
=
set
(
URL_TRANSFORM
.
keys
())
if
urltype
:
urltypes
&=
{
urltype
}
allurls
=
{}
for
lfn
in
lfns
:
allurls
[
lfn
]
=
[]
for
path
in
lfns
[
lfn
]:
# build
file:// and gsiftp://
URL for each
LFN
allurls
[
lfn
].
extend
(
(
_file
_url
(
path
)
,
_gsiftp_url
(
path
),
)
)
# build URL for each
urltype
allurls
[
lfn
].
extend
(
URL_TRANSFORM
[
_url
t
]
(
path
)
for
_urlt
in
sorted
(
urltypes
)
)
# filter URLs for each LFN and return
urls
=
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment