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
47cb6f4e
Commit
47cb6f4e
authored
4 years ago
by
Michael Davis
Browse files
Options
Downloads
Patches
Plain Diff
[cta-admin] Adds tapefile ls --showsuperseded option
parent
9f2236bb
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmdline/CtaAdminCmdParse.hpp
+25
-31
25 additions, 31 deletions
cmdline/CtaAdminCmdParse.hpp
xroot_plugins/XrdCtaTapeFileLs.hpp
+5
-0
5 additions, 0 deletions
xroot_plugins/XrdCtaTapeFileLs.hpp
xrootd-ssi-protobuf-interface
+1
-1
1 addition, 1 deletion
xrootd-ssi-protobuf-interface
with
31 additions
and
32 deletions
cmdline/CtaAdminCmdParse.hpp
+
25
−
31
View file @
47cb6f4e
...
...
@@ -2,7 +2,7 @@
* @project The CERN Tape Archive (CTA)
* @brief Definitions for parsing the options of the CTA Admin command-line tool
* @description CTA Admin command using Google Protocol Buffers and XRootD SSI transport
* @copyright Copyright 20
17
CERN
* @copyright Copyright 20
20
CERN
* @license This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
...
...
@@ -220,7 +220,7 @@ const cmdLookup_t cmdLookup = {
{
"virtualorganization"
,
AdminCmd
::
CMD_VIRTUALORGANIZATION
},
{
"vo"
,
AdminCmd
::
CMD_VIRTUALORGANIZATION
},
{
"version"
,
AdminCmd
::
CMD_VERSION
},
{
"v"
,
AdminCmd
::
CMD_VERSION
},
{
"v"
,
AdminCmd
::
CMD_VERSION
},
};
...
...
@@ -266,6 +266,7 @@ const std::map<std::string, OptionBoolean::Key> boolOptions = {
{
"--justretrieve"
,
OptionBoolean
::
JUSTRETRIEVE
},
{
"--log"
,
OptionBoolean
::
SHOW_LOG_ENTRIES
},
{
"--lookupnamespace"
,
OptionBoolean
::
LOOKUP_NAMESPACE
},
{
"--showsuperseded"
,
OptionBoolean
::
SHOW_SUPERSEDED
},
{
"--summary"
,
OptionBoolean
::
SUMMARY
}
};
...
...
@@ -437,8 +438,7 @@ const Option opt_firstfseq { Option::OPT_UINT, "--firstfseq",
const
Option
opt_force
{
Option
::
OPT_BOOL
,
"--force"
,
"-f"
,
" <
\"
true
\"
or
\"
false
\"
>"
};
const
Option
opt_force_flag
{
Option
::
OPT_FLAG
,
"--force"
,
"-f"
,
""
};
const
Option
opt_gid
{
Option
::
OPT_UINT
,
"--gid"
,
"-g"
,
" <group_id>"
};
const
Option
opt_hostname_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <host_name>"
,
"--hostname"
};
const
Option
opt_hostname_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <host_name>"
,
"--hostname"
};
const
Option
opt_input
{
Option
::
OPT_STR
,
"--input"
,
"-i"
,
" <
\"
zero
\"
or
\"
urandom
\"
>"
};
const
Option
opt_instance
{
Option
::
OPT_STR
,
"--instance"
,
"-i"
,
" <instance_name>"
};
const
Option
opt_justarchive
{
Option
::
OPT_FLAG
,
"--justarchive"
,
"-a"
,
""
};
...
...
@@ -448,59 +448,52 @@ const Option opt_justretrieve { Option::OPT_FLAG, "--justretrieve",
const
Option
opt_lastfseq
{
Option
::
OPT_UINT
,
"--lastfseq"
,
"-l"
,
" <last_fseq>"
};
const
Option
opt_log
{
Option
::
OPT_FLAG
,
"--log"
,
"-l"
,
""
};
const
Option
opt_logicallibrary
{
Option
::
OPT_STR
,
"--logicallibrary"
,
"-l"
,
" <logical_library_name>"
};
const
Option
opt_logicallibrary_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <logical_library_name>"
,
"--logicallibrary"
};
const
Option
opt_logicallibrary_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <logical_library_name>"
,
"--logicallibrary"
};
const
Option
opt_lookupns
{
Option
::
OPT_FLAG
,
"--lookupnamespace"
,
"-l"
,
""
};
const
Option
opt_maxdrivesallowed
{
Option
::
OPT_UINT
,
"--maxdrivesallowed"
,
"-d"
,
" <max_drives_allowed>"
};
const
Option
opt_maxlpos
{
Option
::
OPT_UINT
,
"--maxlpos"
,
"-maxl"
,
" <maximum_longitudinal_position>"
};
const
Option
opt_maxlpos
{
Option
::
OPT_UINT
,
"--maxlpos"
,
"-maxl"
,
" <maximum_longitudinal_position>"
};
const
Option
opt_mediatype
{
Option
::
OPT_STR
,
"--mediatype"
,
"--mt"
,
" <media_type_name>"
};
const
Option
opt_mediatype_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <media_type_name>"
,
"--mediatype"
};
const
Option
opt_mediatype_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <media_type_name>"
,
"--mediatype"
};
const
Option
opt_minarchiverequestage
{
Option
::
OPT_UINT
,
"--minarchiverequestage"
,
"--aa"
,
" <min_request_age>"
};
const
Option
opt_minlpos
{
Option
::
OPT_UINT
,
"--minlpos"
,
"-minl"
,
" <minimum_longitudinal_position>"
};
const
Option
opt_minlpos
{
Option
::
OPT_UINT
,
"--minlpos"
,
"-minl"
,
" <minimum_longitudinal_position>"
};
const
Option
opt_minretrieverequestage
{
Option
::
OPT_UINT
,
"--minretrieverequestage"
,
"--ra"
,
" <min_request_age>"
};
const
Option
opt_mountpolicy
{
Option
::
OPT_STR
,
"--mountpolicy"
,
"-u"
,
" <mount_policy_name>"
};
const
Option
opt_mountpolicy_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <mount_policy_name>"
,
"--mountpolicy"
};
const
Option
opt_mountpolicy_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <mount_policy_name>"
,
"--mountpolicy"
};
const
Option
opt_number_of_files
{
Option
::
OPT_UINT
,
"--nbfiles"
,
"-n"
,
" <number_of_files_per_tape>"
};
const
Option
opt_number_of_files_alias
{
Option
::
OPT_UINT
,
"--number"
,
"-n"
,
" <number_of_files>"
,
"--nbfiles"
};
const
Option
opt_number_of_files_alias
{
Option
::
OPT_UINT
,
"--number"
,
"-n"
,
" <number_of_files>"
,
"--nbfiles"
};
const
Option
opt_number_of_wraps
{
Option
::
OPT_UINT
,
"--nbwraps"
,
"-w"
,
" <number_of_wraps>"
};
const
Option
opt_output
{
Option
::
OPT_STR
,
"--output"
,
"-o"
,
" <
\"
null
\"
or output_dir>"
};
const
Option
opt_owner_uid
{
Option
::
OPT_UINT
,
"--uid"
,
"-u"
,
" <owner_uid>"
};
const
Option
opt_partialfiles
{
Option
::
OPT_UINT
,
"--partial"
,
"-p"
,
" <number_of_files_per_tape>"
};
const
Option
opt_partialtapes
{
Option
::
OPT_UINT
,
"--partialtapesnumber"
,
"-p"
,
" <number_of_partial_tapes>"
};
const
Option
opt_path
{
Option
::
OPT_STR
,
"--path"
,
"-p"
,
" <full_path>"
};
const
Option
opt_primarydensitycode
{
Option
::
OPT_UINT
,
"--primarydensitycode"
,
"-p"
,
" <primary_density_code>"
};
const
Option
opt_primarydensitycode
{
Option
::
OPT_UINT
,
"--primarydensitycode"
,
"-p"
,
" <primary_density_code>"
};
const
Option
opt_retrievepriority
{
Option
::
OPT_UINT
,
"--retrievepriority"
,
"--rp"
,
" <priority_value>"
};
const
Option
opt_secondarydensitycode
{
Option
::
OPT_UINT
,
"--secondarydensitycode"
,
"-s"
,
" <secondary_density_code>"
};
const
Option
opt_size
{
Option
::
OPT_UINT
,
"--size"
,
"-s"
,
" <file_size>"
};
const
Option
opt_storageclass
{
Option
::
OPT_STR
,
"--storageclass"
,
"-s"
,
" <storage_class_name>"
};
const
Option
opt_storageclass_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <storage_class_name>"
,
"--storageclass"
};
const
Option
opt_storageclass_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <storage_class_name>"
,
"--storageclass"
};
const
Option
opt_summary
{
Option
::
OPT_FLAG
,
"--summary"
,
"-S"
,
""
};
const
Option
opt_supply
{
Option
::
OPT_STR
,
"--supply"
,
"-s"
,
" <supply_value>"
};
const
Option
opt_tapepool
{
Option
::
OPT_STR
,
"--tapepool"
,
"-t"
,
" <tapepool_name>"
};
const
Option
opt_tapepool_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <tapepool_name>"
,
"--tapepool"
};
const
Option
opt_tapepool_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <tapepool_name>"
,
"--tapepool"
};
const
Option
opt_username
{
Option
::
OPT_STR
,
"--username"
,
"-u"
,
" <user_name>"
};
const
Option
opt_username_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <user_name>"
,
"--username"
};
const
Option
opt_username_alias
{
Option
::
OPT_STR
,
"--name"
,
"-n"
,
" <user_name>"
,
"--username"
};
const
Option
opt_vendor
{
Option
::
OPT_STR
,
"--vendor"
,
"--ve"
,
" <vendor>"
};
const
Option
opt_vid
{
Option
::
OPT_STR
,
"--vid"
,
"-v"
,
" <vid>"
};
const
Option
opt_vo
{
Option
::
OPT_STR
,
"--vo"
,
"--vo"
,
" <vo>"
};
const
Option
opt_vidfile
{
Option
::
OPT_STR_LIST
,
"--vidfile"
,
"-f"
,
" <filename>"
};
const
Option
opt_full
{
Option
::
OPT_BOOL
,
"--full"
,
"-f"
,
" <
\"
true
\"
or
\"
false
\"
>"
};
const
Option
opt_readonly
{
Option
::
OPT_BOOL
,
"--readonly"
,
"-r"
,
" <
\"
true
\"
or
\"
false
\"
>"
};
const
Option
opt_disabled_tape
{
Option
::
OPT_FLAG
,
"--disabledtape"
,
"-d"
,
""
};
const
Option
opt_
disksystem
{
Option
::
OPT_STR
,
"--
disksystem
"
,
"-
n
"
,
" <
disk_system_name
>"
};
const
Option
opt_f
ile_regexp
{
Option
::
OPT_STR
,
"--f
ileregexp"
,
"-
r
"
,
" <f
ile_regexp
>"
};
const
Option
opt_fre
e_space_query_url
{
Option
::
OPT_
STR
,
"--fre
espacequeryur
l"
,
"-
u
"
,
" <fre
e_space_query_ur
l>"
};
const
Option
opt_
refresh_interval
{
Option
::
OPT_UINT
,
"--
refreshinterval"
,
"-
i
"
,
" <
refresh_intreval
>"
};
const
Option
opt_
targeted_free_space
{
Option
::
OPT_UINT
,
"--
targetedfreespace"
,
"-
f
"
,
" <
targeted_free_space
>"
};
const
Option
opt_
sleep_time
{
Option
::
OPT_
UINT
,
"--sleeptime
"
,
"-
s
"
,
" <
sleep time in s
>"
};
const
Option
opt_
reason
{
Option
::
OPT_
STR
,
"--
reason"
,
"-
r
"
,
" <reason_status_change>
"
};
const
Option
opt_disabled_tape
{
Option
::
OPT_FLAG
,
"--disabledtape"
,
"-d"
,
""
};
const
Option
opt_disksystem
{
Option
::
OPT_STR
,
"--disksystem"
,
"-n"
,
" <disk_system_name>"
};
const
Option
opt_
file_regexp
{
Option
::
OPT_STR
,
"--
fileregexp
"
,
"-
r
"
,
" <
file_regexp
>"
};
const
Option
opt_f
ree_space_query_url
{
Option
::
OPT_STR
,
"--f
reespacequeryurl"
,
"-
u
"
,
" <f
ree_space_query_url
>"
};
const
Option
opt_
re
fre
sh_interval
{
Option
::
OPT_
UINT
,
"--
re
fre
shinterva
l"
,
"-
i
"
,
" <
re
fre
sh_intreva
l>"
};
const
Option
opt_
targeted_free_space
{
Option
::
OPT_UINT
,
"--
targetedfreespace"
,
"-
f
"
,
" <
targeted_free_space
>"
};
const
Option
opt_
sleep_time
{
Option
::
OPT_UINT
,
"--
sleeptime"
,
"-
s
"
,
" <
sleep time in s
>"
};
const
Option
opt_
reason
{
Option
::
OPT_
STR
,
"--reason
"
,
"-
r
"
,
" <
reason_status_change
>"
};
const
Option
opt_
show_superseded
{
Option
::
OPT_
FLAG
,
"--
showsuperseded"
,
"-
s
"
,
"
"
};
/*!
* Map valid options to commands
...
...
@@ -612,7 +605,8 @@ const std::map<cmd_key_t, cmd_val_t> cmdOptions = {
{{
AdminCmd
::
CMD_TAPE
,
AdminCmd
::
SUBCMD_LABEL
},
{
opt_vid
,
opt_force
.
optional
()
}},
/*----------------------------------------------------------------------------------------------------*/
{{
AdminCmd
::
CMD_TAPEFILE
,
AdminCmd
::
SUBCMD_LS
},
{
opt_vid
,
opt_lookupns
.
optional
()
}},
{{
AdminCmd
::
CMD_TAPEFILE
,
AdminCmd
::
SUBCMD_LS
},
{
opt_vid
,
opt_lookupns
.
optional
(),
opt_show_superseded
.
optional
()
}},
/*----------------------------------------------------------------------------------------------------*/
{{
AdminCmd
::
CMD_TAPEPOOL
,
AdminCmd
::
SUBCMD_ADD
},
{
opt_tapepool_alias
,
opt_vo
,
opt_partialtapes
,
opt_encrypted
,
opt_supply
.
optional
(),
opt_comment
}},
...
...
This diff is collapsed.
Click to expand it.
xroot_plugins/XrdCtaTapeFileLs.hpp
+
5
−
0
View file @
47cb6f4e
...
...
@@ -58,6 +58,7 @@ private:
catalogue
::
ArchiveFileItor
m_tapeFileItor
;
//!< Iterator across files which have been archived
grpc
::
EndpointMap
m_endpoints
;
//!< List of gRPC endpoints
bool
m_LookupNamespace
;
//!< True if namespace lookup is required
bool
m_ShowSuperseded
;
//!< True if superseded files should be included in the output
static
constexpr
const
char
*
const
LOG_SUFFIX
=
"TapeFileLsStream"
;
//!< Identifier for log messages
};
...
...
@@ -74,6 +75,7 @@ TapeFileLsStream::TapeFileLsStream(const RequestMessage &requestMsg,
XrdSsiPb
::
Log
::
Msg
(
XrdSsiPb
::
Log
::
DEBUG
,
LOG_SUFFIX
,
"TapeFileLsStream() constructor"
);
m_LookupNamespace
=
true
;
m_ShowSuperseded
=
requestMsg
.
has_flag
(
OptionBoolean
::
SHOW_SUPERSEDED
);
cta
::
catalogue
::
TapeFileSearchCriteria
searchCriteria
;
searchCriteria
.
vid
=
requestMsg
.
getRequired
(
OptionString
::
VID
);
...
...
@@ -89,6 +91,9 @@ int TapeFileLsStream::fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf) {
for
(
auto
jt
=
archiveFile
.
tapeFiles
.
cbegin
();
jt
!=
archiveFile
.
tapeFiles
.
cend
();
jt
++
)
{
Data
record
;
// Skip superseded files unless explicitly requested to show them
if
(
!
(
m_ShowSuperseded
||
jt
->
supersededByVid
.
empty
()))
continue
;
// Archive file
auto
af
=
record
.
mutable_tfls_item
()
->
mutable_af
();
af
->
set_archive_id
(
archiveFile
.
archiveFileID
);
...
...
This diff is collapsed.
Click to expand it.
xrootd-ssi-protobuf-interface
@
ba21aae1
Subproject commit
29c0f19440cef4273e982ff1f0f0ff05f588764d
Subproject commit
ba21aae1c1bcca1cba6060343c1d704add563549
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