Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
dCache
cta
Commits
94a72680
Commit
94a72680
authored
5 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[frontend] Handles "cta-admin tape ls --fidfile <file>" in Frontend
parent
dc662d14
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
catalogue/TapeSearchCriteria.hpp
+6
-1
6 additions, 1 deletion
catalogue/TapeSearchCriteria.hpp
xroot_plugins/XrdCtaTapeLs.hpp
+20
-19
20 additions, 19 deletions
xroot_plugins/XrdCtaTapeLs.hpp
with
26 additions
and
20 deletions
catalogue/TapeSearchCriteria.hpp
+
6
−
1
View file @
94a72680
...
...
@@ -19,8 +19,9 @@
#pragma once
#include
<string>
#include
<vector>
#include
"
common/optional.hpp
"
#include
<
common/optional.hpp
>
namespace
cta
{
namespace
catalogue
{
...
...
@@ -86,6 +87,10 @@ struct TapeSearchCriteria {
*/
optional
<
bool
>
readOnly
;
/**
* List of disk file IDs to search for.
*/
optional
<
std
::
vector
<
std
::
string
>>
diskFileIds
;
};
// struct TapeSearchCriteria
}
// namespace catalogue
...
...
This diff is collapsed.
Click to expand it.
xroot_plugins/XrdCtaTapeLs.hpp
+
20
−
19
View file @
94a72680
...
...
@@ -66,25 +66,26 @@ TapeLsStream::TapeLsStream(const RequestMessage &requestMsg, cta::catalogue::Cat
cta
::
catalogue
::
TapeSearchCriteria
searchCriteria
;
if
(
!
requestMsg
.
has_flag
(
OptionBoolean
::
ALL
))
{
bool
has_any
=
false
;
// set to true if at least one optional option is set
// Get the search criteria from the optional options
searchCriteria
.
disabled
=
requestMsg
.
getOptional
(
OptionBoolean
::
DISABLED
,
&
has_any
);
searchCriteria
.
readOnly
=
requestMsg
.
getOptional
(
OptionBoolean
::
READ_ONLY
,
&
has_any
);
searchCriteria
.
full
=
requestMsg
.
getOptional
(
OptionBoolean
::
FULL
,
&
has_any
);
searchCriteria
.
capacityInBytes
=
requestMsg
.
getOptional
(
OptionUInt64
::
CAPACITY
,
&
has_any
);
searchCriteria
.
logicalLibrary
=
requestMsg
.
getOptional
(
OptionString
::
LOGICAL_LIBRARY
,
&
has_any
);
searchCriteria
.
tapePool
=
requestMsg
.
getOptional
(
OptionString
::
TAPE_POOL
,
&
has_any
);
searchCriteria
.
vo
=
requestMsg
.
getOptional
(
OptionString
::
VO
,
&
has_any
);
searchCriteria
.
vid
=
requestMsg
.
getOptional
(
OptionString
::
VID
,
&
has_any
);
searchCriteria
.
mediaType
=
requestMsg
.
getOptional
(
OptionString
::
MEDIA_TYPE
,
&
has_any
);
searchCriteria
.
vendor
=
requestMsg
.
getOptional
(
OptionString
::
VENDOR
,
&
has_any
);
if
(
!
has_any
)
{
throw
cta
::
exception
::
UserError
(
"Must specify at least one search option, or --all"
);
}
bool
has_any
=
false
;
// set to true if at least one optional option is set
// Get the search criteria from the optional options
searchCriteria
.
disabled
=
requestMsg
.
getOptional
(
OptionBoolean
::
DISABLED
,
&
has_any
);
searchCriteria
.
readOnly
=
requestMsg
.
getOptional
(
OptionBoolean
::
READ_ONLY
,
&
has_any
);
searchCriteria
.
full
=
requestMsg
.
getOptional
(
OptionBoolean
::
FULL
,
&
has_any
);
searchCriteria
.
capacityInBytes
=
requestMsg
.
getOptional
(
OptionUInt64
::
CAPACITY
,
&
has_any
);
searchCriteria
.
logicalLibrary
=
requestMsg
.
getOptional
(
OptionString
::
LOGICAL_LIBRARY
,
&
has_any
);
searchCriteria
.
tapePool
=
requestMsg
.
getOptional
(
OptionString
::
TAPE_POOL
,
&
has_any
);
searchCriteria
.
vo
=
requestMsg
.
getOptional
(
OptionString
::
VO
,
&
has_any
);
searchCriteria
.
vid
=
requestMsg
.
getOptional
(
OptionString
::
VID
,
&
has_any
);
searchCriteria
.
mediaType
=
requestMsg
.
getOptional
(
OptionString
::
MEDIA_TYPE
,
&
has_any
);
searchCriteria
.
vendor
=
requestMsg
.
getOptional
(
OptionString
::
VENDOR
,
&
has_any
);
searchCriteria
.
diskFileIds
=
requestMsg
.
getOptional
(
OptionStrList
::
FILE_ID
,
&
has_any
);
if
(
!
(
requestMsg
.
has_flag
(
OptionBoolean
::
ALL
)
||
has_any
))
{
throw
cta
::
exception
::
UserError
(
"Must specify at least one search option, or --all"
);
}
else
if
(
requestMsg
.
has_flag
(
OptionBoolean
::
ALL
)
&&
has_any
)
{
throw
cta
::
exception
::
UserError
(
"Cannot specify --all together with other search options, they are mutually exclusive"
);
}
m_tapeList
=
m_catalogue
.
getTapes
(
searchCriteria
);
...
...
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