Commit dbf55d8c authored by Daniele Kruse's avatar Daniele Kruse
Browse files

More work on the CLI, changed a bit the archivefile list interface

parent ff068ed4
......@@ -162,10 +162,10 @@ public:
virtual void modifyDedicationUntil(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &drivename, const uint64_t untilTimestamp) = 0;
virtual void modifyDedicationComment(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &drivename, const std::string &comment) = 0;
virtual std::list<cta::common::dataStructures::ArchiveFile> getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) = 0;
virtual cta::common::dataStructures::ArchiveFileSummary getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) = 0;
virtual std::list<cta::common::dataStructures::ArchiveFile> getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) = 0;
virtual cta::common::dataStructures::ArchiveFileSummary getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) = 0;
virtual void setDriveStatus(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &driveName, const bool up, const bool force) = 0;
......
......@@ -393,16 +393,16 @@ void cta::catalogue::MockCatalogue::modifyDedicationComment(const cta::common::d
//------------------------------------------------------------------------------
// getArchiveFiles
//------------------------------------------------------------------------------
std::list<cta::common::dataStructures::ArchiveFile> cta::catalogue::MockCatalogue::getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) {
std::list<cta::common::dataStructures::ArchiveFile> cta::catalogue::MockCatalogue::getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) {
return std::list<cta::common::dataStructures::ArchiveFile>();
}
//------------------------------------------------------------------------------
// getArchiveFileSummary
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveFileSummary cta::catalogue::MockCatalogue::getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) {
cta::common::dataStructures::ArchiveFileSummary cta::catalogue::MockCatalogue::getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) {
return cta::common::dataStructures::ArchiveFileSummary();
}
......
......@@ -134,10 +134,10 @@ public:
virtual void modifyDedicationUntil(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &drivename, const uint64_t untilTimestamp);
virtual void modifyDedicationComment(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &drivename, const std::string &comment);
virtual std::list<cta::common::dataStructures::ArchiveFile> getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual cta::common::dataStructures::ArchiveFileSummary getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual std::list<cta::common::dataStructures::ArchiveFile> getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual cta::common::dataStructures::ArchiveFileSummary getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual void setDriveStatus(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &driveName, const bool up, const bool force);
/**
......
......@@ -82,9 +82,9 @@ cta ve/verify add/rm/ls/err:
cta af/archivefile ls [--id/-I <archive_file_id>] [--copynb/-c <copy_no>] [--vid/-v <vid>] [--tapepool/-t <tapepool>] [--owner/-o <owner>] [--group/-g <group>] [--storageclass/-s <class>] [--path/-p <fullpath>] [--summary/-S] [--all/-a] (default gives error)
cta te/test read/write (to be run on an empty self-dedicated drive; it is a synchronous command that returns performance stats and errors; all locations are local to the tapeserver):
cta te/test read/write_rand/write_def (to be run on an empty self-dedicated drive; it is a synchronous command that returns performance stats and errors; all locations are local to the tapeserver):
read --drive/-d <drive_name> --vid/-v <vid> --firstfseq/-f <first_fseq> --lastfseq/-l <last_fseq> --checkchecksum/-c --retries_per_file/-r <number_of_retries_per_file> [--outputdir/-o <output_dir> or --null/-n] [--tag/-t <tag_name>]
write_rand --drive/-d <drive_name> --vid/-v <vid> --number/-n <number_of_files> [--size/-s <file_size> or --randomsize/-r] [--zero/-z or --urandom/-u] [--tag/-t <tag_name>]
write_rand --drive/-d <drive_name> --vid/-v <vid> --number/-n <number_of_files> --size/-s <file_size> [--zero/-z or --urandom/-u] [--tag/-t <tag_name>]
write_def --drive/-d <drive_name> --vid/-v <vid> [--file/-f <filename> or --filelist/-f <filename_with_file_list>] [--tag/-t <tag_name>]
cta dr/drive up/down (it is a synchronous command):
......
......@@ -185,9 +185,9 @@ virtual void cancelVerify
virtual std::list<VerifyInfo> getVerifys (const SecurityIdentity &requester) const;
virtual VerifyInfo getVerify (const SecurityIdentity &requester, const std::string &vid) const;
virtual std::list<ArchiveFile> getArchiveFiles (const SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
virtual std::list<ArchiveFile> getArchiveFiles (const SecurityIdentity &requester, const std::string &id, const std::string &eosid, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual ArchiveFileSummary getArchiveFileSummary (const SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
virtual ArchiveFileSummary getArchiveFileSummary (const SecurityIdentity &requester, const std::string &id, const std::string &eosid, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual readTestResult readTest (const SecurityIdentity &requester, const std::string &driveName, const std::string &vid, const uint64_t firstFSeq, const uint64_t lastFSeq,
......
......@@ -84,9 +84,9 @@ virtual void modifyDedicatio
virtual void modifyDedicationUntil (const SecurityIdentity &requester, const std::string &drivename, const uint64_t untilTimestamp);
virtual void modifyDedicationComment (const SecurityIdentity &requester, const std::string &drivename, const std::string &comment);
virtual std::list<ArchiveFile> getArchiveFiles (const SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
virtual std::list<ArchiveFile> getArchiveFiles (const SecurityIdentity &requester, const std::string &id, const std::string &eosid, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual ArchiveFileSummary getArchiveFileSummary (const SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
virtual ArchiveFileSummary getArchiveFileSummary (const SecurityIdentity &requester, const std::string &id, const std::string &eosid, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual void setDriveStatus (const SecurityIdentity &requester, const std::string &driveName, const bool up, const bool force);
......@@ -641,16 +641,16 @@ cta::common::dataStructures::VerifyInfo cta::Scheduler::getVerify(const cta::com
//------------------------------------------------------------------------------
// getArchiveFiles
//------------------------------------------------------------------------------
std::list<cta::common::dataStructures::ArchiveFile> cta::Scheduler::getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) {
std::list<cta::common::dataStructures::ArchiveFile> cta::Scheduler::getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) {
return std::list<cta::common::dataStructures::ArchiveFile>();
}
//------------------------------------------------------------------------------
// getArchiveFileSummary
//------------------------------------------------------------------------------
cta::common::dataStructures::ArchiveFileSummary cta::Scheduler::getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) {
cta::common::dataStructures::ArchiveFileSummary cta::Scheduler::getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path) {
return cta::common::dataStructures::ArchiveFileSummary();
}
......
......@@ -201,10 +201,10 @@ public:
virtual std::list<cta::common::dataStructures::VerifyInfo> getVerifys(const cta::common::dataStructures::SecurityIdentity &requester) const;
virtual cta::common::dataStructures::VerifyInfo getVerify(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &vid) const;
virtual std::list<cta::common::dataStructures::ArchiveFile> getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual cta::common::dataStructures::ArchiveFileSummary getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &copynb, const std::string &tapepool,
const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual std::list<cta::common::dataStructures::ArchiveFile> getArchiveFiles(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual cta::common::dataStructures::ArchiveFileSummary getArchiveFileSummary(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &id, const std::string &eosid,
const std::string &copynb, const std::string &tapepool, const std::string &vid, const std::string &owner, const std::string &group, const std::string &storageclass, const std::string &path);
virtual cta::common::dataStructures::ReadTestResult readTest(const cta::common::dataStructures::SecurityIdentity &requester, const std::string &driveName, const std::string &vid, const uint64_t firstFSeq, const uint64_t lastFSeq,
const bool checkChecksum, const uint64_t retriesPerFile, const std::string &outputDir, const bool redirectToDevNull, const std::string &tag) const;
......
......@@ -1513,10 +1513,11 @@ void XrdProFile::xCom_verify(const std::vector<std::string> &tokens, const cta::
//------------------------------------------------------------------------------
void XrdProFile::xCom_archivefile(const std::vector<std::string> &tokens, const cta::common::dataStructures::SecurityIdentity &requester) {
std::stringstream help;
help << tokens[0] << " af/archivefile ls [--id/-I <archive_file_id>] [--copynb/-c <copy_no>] [--vid/-v <vid>] [--tapepool/-t <tapepool>] "
help << tokens[0] << " af/archivefile ls [--id/-I <archive_file_id>] [--eosid/-e <eos_id>] [--copynb/-c <copy_no>] [--vid/-v <vid>] [--tapepool/-t <tapepool>] "
"[--owner/-o <owner>] [--group/-g <group>] [--storageclass/-s <class>] [--path/-p <fullpath>] [--summary/-S] [--all/-a] (default gives error)" << std::endl;
if("ls" == tokens[2]) { //ls
std::string id = getOptionValue(tokens, "-I", "--id");
std::string eosid = getOptionValue(tokens, "-e", "--eosid");
std::string copynb = getOptionValue(tokens, "-c", "--copynb");
std::string tapepool = getOptionValue(tokens, "-t", "--tapepool");
std::string vid = getOptionValue(tokens, "-v", "--vid");
......@@ -1531,7 +1532,7 @@ void XrdProFile::xCom_archivefile(const std::vector<std::string> &tokens, const
return;
}
if(!summary) {
std::list<cta::common::dataStructures::ArchiveFile> list=m_scheduler->getArchiveFiles(requester, id, copynb, tapepool, vid, owner, group, storageclass, path);
std::list<cta::common::dataStructures::ArchiveFile> list=m_scheduler->getArchiveFiles(requester, id, eosid, copynb, tapepool, vid, owner, group, storageclass, path);
if(list.size()>0) {
std::vector<std::vector<std::string>> responseTable;
std::vector<std::string> header = {"id","copy no","vid","fseq","block id","EOS id","size","checksum type","checksum value","storage class","owner","group","instance","path"};
......@@ -1560,7 +1561,7 @@ void XrdProFile::xCom_archivefile(const std::vector<std::string> &tokens, const
}
}
else { //summary
cta::common::dataStructures::ArchiveFileSummary summary=m_scheduler->getArchiveFileSummary(requester, id, copynb, tapepool, vid, owner, group, storageclass, path);
cta::common::dataStructures::ArchiveFileSummary summary=m_scheduler->getArchiveFileSummary(requester, id, eosid, copynb, tapepool, vid, owner, group, storageclass, path);
std::vector<std::vector<std::string>> responseTable;
std::vector<std::string> header = {"total number of files","total size"};
std::vector<std::string> row = {std::to_string((unsigned long long)summary.getTotalFiles()),std::to_string((unsigned long long)summary.getTotalBytes())};
......@@ -1578,9 +1579,9 @@ void XrdProFile::xCom_archivefile(const std::vector<std::string> &tokens, const
//------------------------------------------------------------------------------
void XrdProFile::xCom_test(const std::vector<std::string> &tokens, const cta::common::dataStructures::SecurityIdentity &requester) {
std::stringstream help;
help << tokens[0] << " te/test read/write (to be run on an empty self-dedicated drive; it is a synchronous command that returns performance stats and errors; all locations are local to the tapeserver):" << std::endl
help << tokens[0] << " te/test read/write_rand/write_def (to be run on an empty self-dedicated drive; it is a synchronous command that returns performance stats and errors; all locations are local to the tapeserver):" << std::endl
<< "\tread --drive/-d <drive_name> --vid/-v <vid> --firstfseq/-f <first_fseq> --lastfseq/-l <last_fseq> --checkchecksum/-c --retries_per_file/-r <number_of_retries_per_file> [--outputdir/-o <output_dir> or --null/-n] [--tag/-t <tag_name>]" << std::endl
<< "\twrite_rand --drive/-d <drive_name> --vid/-v <vid> --number/-n <number_of_files> [--size/-s <file_size> or --randomsize/-r] [--zero/-z or --urandom/-u] [--tag/-t <tag_name>]" << std::endl
<< "\twrite_rand --drive/-d <drive_name> --vid/-v <vid> --number/-n <number_of_files> --size/-s <file_size> [--zero/-z or --urandom/-u] [--tag/-t <tag_name>]" << std::endl
<< "\twrite_def --drive/-d <drive_name> --vid/-v <vid> [--file/-f <filename> or --filelist/-f <filename_with_file_list>] [--tag/-t <tag_name>]" << std::endl;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment