Commit b17b5e0d authored by Steven Murray's avatar Steven Murray
Browse files

cta/CTA#294 Added VO column to TAPE_POOL table

parent de937cd1
......@@ -42,7 +42,10 @@ set (CATALOGUE_LIB_SRC_FILES
SqliteCatalogue.cpp
TapeForWriting.cpp
UserSpecifiedANonEmptyTape.cpp
UserSpecifiedANonExistentTape.cpp)
UserSpecifiedANonExistentTape.cpp
UserSpecifiedAnEmptyStringComment.cpp
UserSpecifiedAnEmptyStringTapePoolName.cpp
UserSpecifiedAnEmptyStringVo.cpp)
add_library (ctacatalogue SHARED
${CATALOGUE_LIB_SRC_FILES})
......
......@@ -265,9 +265,10 @@ public:
virtual void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const uint64_t nbCopies) = 0;
virtual void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const std::string &comment) = 0;
virtual void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) = 0;
virtual void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) = 0;
virtual void deleteTapePool(const std::string &name) = 0;
virtual std::list<TapePool> getTapePools() const = 0;
virtual void modifyTapePoolVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) = 0;
virtual void modifyTapePoolNbPartialTapes(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbPartialTapes) = 0;
virtual void modifyTapePoolComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0;
virtual void setTapePoolEncryption(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool encryptionValue) = 0;
......
......@@ -141,8 +141,8 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassComment(admin, instanceName, name, comment);}, m_maxTriesToConnect);
}
void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createTapePool(admin, name, nbPartialTapes, encryptionValue, comment);}, m_maxTriesToConnect);
void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createTapePool(admin, name, vo, nbPartialTapes, encryptionValue, comment);}, m_maxTriesToConnect);
}
void deleteTapePool(const std::string &name) override {
......@@ -153,6 +153,10 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->getTapePools();}, m_maxTriesToConnect);
}
void modifyTapePoolVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyTapePoolVo(admin, name, vo);}, m_maxTriesToConnect);
}
void modifyTapePoolNbPartialTapes(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbPartialTapes) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyTapePoolNbPartialTapes(admin, name, nbPartialTapes);}, m_maxTriesToConnect);
}
......
This diff is collapsed.
......@@ -42,7 +42,7 @@ public:
void createRequesterMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstance, const std::string& requesterName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createStorageClass(const common::dataStructures::SecurityIdentity& admin, const common::dataStructures::StorageClass& storageClass) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createTape(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string& logicalLibraryName, const std::string& tapePoolName, const uint64_t capacityInBytes, const bool disabled, const bool full, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createTapePool(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createTapePool(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string & vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteAdminUser(const std::string& username) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteArchiveFile(const std::string& instanceName, const uint64_t archiveFileId, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void deleteArchiveFileByDiskFileId(const std::string &diskInstanceName, const std::string &diskFileId, log::LogContext &lc) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......@@ -92,6 +92,7 @@ public:
void modifyTapeEncryptionKey(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string& encryptionKey) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapeLogicalLibraryName(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string& logicalLibraryName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapePoolComment(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapePoolVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapePoolNbPartialTapes(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t nbPartialTapes) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapeTapePoolName(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const std::string& tapePoolName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void noSpaceLeftOnTape(const std::string& vid) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
......@@ -23,6 +23,9 @@
#include "catalogue/SqliteCatalogueSchema.hpp"
#include "catalogue/UserSpecifiedANonEmptyTape.hpp"
#include "catalogue/UserSpecifiedANonExistentTape.hpp"
#include "catalogue/UserSpecifiedAnEmptyStringComment.hpp"
#include "catalogue/UserSpecifiedAnEmptyStringTapePoolName.hpp"
#include "catalogue/UserSpecifiedAnEmptyStringVo.hpp"
#include "common/dataStructures/TapeFile.hpp"
#include "common/exception/Exception.hpp"
#include "common/exception/UserError.hpp"
......@@ -524,10 +527,25 @@ void RdbmsCatalogue::modifyStorageClassComment(const common::dataStructures::Sec
void RdbmsCatalogue::createTapePool(
const common::dataStructures::SecurityIdentity &admin,
const std::string &name,
const std::string &vo,
const uint64_t nbPartialTapes,
const bool encryptionValue,
const std::string &comment) {
try {
if(name.empty()) {
throw UserSpecifiedAnEmptyStringTapePoolName("Cannot create tape pool because the tape pool name is an empty string");
}
if(vo.empty()) {
throw UserSpecifiedAnEmptyStringVo(std::string("Cannot create tape pool ") + name +
" because the VO is an empty string");
}
if(comment.empty()) {
throw UserSpecifiedAnEmptyStringComment(std::string("Cannot create tape pool ") + name +
" because the comment is an empty string");
}
auto conn = m_connPool.getConn();
if(tapePoolExists(conn, name)) {
......@@ -538,6 +556,7 @@ void RdbmsCatalogue::createTapePool(
const char *const sql =
"INSERT INTO TAPE_POOL("
"TAPE_POOL_NAME,"
"VO,"
"NB_PARTIAL_TAPES,"
"IS_ENCRYPTED,"
......@@ -552,6 +571,7 @@ void RdbmsCatalogue::createTapePool(
"LAST_UPDATE_TIME)"
"VALUES("
":TAPE_POOL_NAME,"
":VO,"
":NB_PARTIAL_TAPES,"
":IS_ENCRYPTED,"
......@@ -567,6 +587,7 @@ void RdbmsCatalogue::createTapePool(
auto stmt = conn.createStmt(sql, rdbms::AutocommitMode::ON);
stmt.bindString(":TAPE_POOL_NAME", name);
stmt.bindString(":VO", vo);
stmt.bindUint64(":NB_PARTIAL_TAPES", nbPartialTapes);
stmt.bindBool(":IS_ENCRYPTED", encryptionValue);
......@@ -827,6 +848,7 @@ std::list<TapePool> RdbmsCatalogue::getTapePools() const {
const char *const sql =
"SELECT "
"TAPE_POOL.TAPE_POOL_NAME AS TAPE_POOL_NAME,"
"COALESCE(TAPE_POOL.VO, 'NONE') AS VO," // TBD Remove COALESCE
"TAPE_POOL.NB_PARTIAL_TAPES AS NB_PARTIAL_TAPES,"
"TAPE_POOL.IS_ENCRYPTED AS IS_ENCRYPTED,"
......@@ -849,6 +871,7 @@ std::list<TapePool> RdbmsCatalogue::getTapePools() const {
"TAPE_POOL.TAPE_POOL_NAME = TAPE.TAPE_POOL_NAME "
"GROUP BY "
"TAPE_POOL.TAPE_POOL_NAME,"
"TAPE_POOL.VO,"
"TAPE_POOL.NB_PARTIAL_TAPES,"
"TAPE_POOL.IS_ENCRYPTED,"
"TAPE_POOL.USER_COMMENT,"
......@@ -868,6 +891,7 @@ std::list<TapePool> RdbmsCatalogue::getTapePools() const {
TapePool pool;
pool.name = rset.columnString("TAPE_POOL_NAME");
pool.vo = rset.columnString("VO");
pool.nbPartialTapes = rset.columnUint64("NB_PARTIAL_TAPES");
pool.encryption = rset.columnBool("IS_ENCRYPTED");
pool.nbTapes = rset.columnUint64("NB_TAPES");
......@@ -893,6 +917,46 @@ std::list<TapePool> RdbmsCatalogue::getTapePools() const {
}
}
//------------------------------------------------------------------------------
// modifyTapePoolVO
//------------------------------------------------------------------------------
void RdbmsCatalogue::modifyTapePoolVo(const common::dataStructures::SecurityIdentity &admin,
const std::string &name, const std::string &vo) {
try {
if(vo.empty()) {
throw UserSpecifiedAnEmptyStringVo(std::string("Cannot modify tape pool ") + name +
" because the new VO is an empty string");
}
const time_t now = time(nullptr);
const char *const sql =
"UPDATE TAPE_POOL SET "
"VO = :VO,"
"LAST_UPDATE_USER_NAME = :LAST_UPDATE_USER_NAME,"
"LAST_UPDATE_HOST_NAME = :LAST_UPDATE_HOST_NAME,"
"LAST_UPDATE_TIME = :LAST_UPDATE_TIME "
"WHERE "
"TAPE_POOL_NAME = :TAPE_POOL_NAME";
auto conn = m_connPool.getConn();
auto stmt = conn.createStmt(sql, rdbms::AutocommitMode::ON);
stmt.bindString(":VO", vo);
stmt.bindString(":LAST_UPDATE_USER_NAME", admin.username);
stmt.bindString(":LAST_UPDATE_HOST_NAME", admin.host);
stmt.bindUint64(":LAST_UPDATE_TIME", now);
stmt.bindString(":TAPE_POOL_NAME", name);
stmt.executeNonQuery();
if(0 == stmt.getNbAffectedRows()) {
throw exception::UserError(std::string("Cannot modify tape pool ") + name + " because it does not exist");
}
} catch(exception::UserError &) {
throw;
} catch(exception::Exception &ex) {
ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str());
throw;
}
}
//------------------------------------------------------------------------------
// modifyTapePoolNbPartialTapes
//------------------------------------------------------------------------------
......@@ -934,6 +998,11 @@ void RdbmsCatalogue::modifyTapePoolNbPartialTapes(const common::dataStructures::
void RdbmsCatalogue::modifyTapePoolComment(const common::dataStructures::SecurityIdentity &admin,
const std::string &name, const std::string &comment) {
try {
if(comment.empty()) {
throw UserSpecifiedAnEmptyStringComment(std::string("Cannot modify tape pool ") + name +
" because the new comment is an empty string");
}
const time_t now = time(nullptr);
const char *const sql =
"UPDATE TAPE_POOL SET "
......
......@@ -264,9 +264,10 @@ public:
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const uint64_t nbCopies) override;
void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &name, const std::string &comment) override;
void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) override;
void createTapePool(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo, const uint64_t nbPartialTapes, const bool encryptionValue, const std::string &comment) override;
void deleteTapePool(const std::string &name) override;
std::list<TapePool> getTapePools() const override;
void modifyTapePoolVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) override;
void modifyTapePoolNbPartialTapes(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbPartialTapes) override;
void modifyTapePoolComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override;
void setTapePoolEncryption(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const bool encryptionValue) override;
......
......@@ -51,6 +51,7 @@ bool TapePool::operator!=(const TapePool &rhs) const {
//------------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &os, const TapePool &obj) {
os << "(name=" << obj.name
<< " vo=" << obj.vo
<< " nbPartialTapes=" << obj.nbPartialTapes
<< " encryption=" << obj.encryption
<< " nbTapes=" << obj.nbTapes
......
......@@ -58,6 +58,11 @@ struct TapePool {
*/
std::string name;
/**
* The virtual organisation of the tape pool.
*/
std::string vo;
/**
* The desired number of tapes that should be empty or partially filled.
*/
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/UserSpecifiedAnEmptyStringComment.hpp"
namespace cta {
namespace catalogue {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
UserSpecifiedAnEmptyStringComment::UserSpecifiedAnEmptyStringComment(const std::string &context,
const bool embedBacktrace): cta::exception::UserError(context, embedBacktrace) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
UserSpecifiedAnEmptyStringComment::~UserSpecifiedAnEmptyStringComment() {
}
} // namespace catalogue
} // namespace cta
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/exception/UserError.hpp"
namespace cta {
namespace catalogue {
/**
* User specified an empty string for a comment when this is not permitted.
*/
class UserSpecifiedAnEmptyStringComment: public exception::UserError {
public:
/**
* Constructor.
*
* @param context optional context string added to the message
* at initialisation time.
* @param embedBacktrace whether to embed a backtrace of where the
* exception was throw in the message
*/
UserSpecifiedAnEmptyStringComment(const std::string &context = "", const bool embedBacktrace = true);
/**
* Destructor.
*/
~UserSpecifiedAnEmptyStringComment() override;
}; // class UserSpecifiedAnEmptyStringComment
} // namespace catalogue
} // namespace cta
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/UserSpecifiedAnEmptyStringTapePoolName.hpp"
namespace cta {
namespace catalogue {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
UserSpecifiedAnEmptyStringTapePoolName::UserSpecifiedAnEmptyStringTapePoolName(const std::string &context,
const bool embedBacktrace): cta::exception::UserError(context, embedBacktrace) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
UserSpecifiedAnEmptyStringTapePoolName::~UserSpecifiedAnEmptyStringTapePoolName() {
}
} // namespace catalogue
} // namespace cta
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/exception/UserError.hpp"
namespace cta {
namespace catalogue {
/**
* User specified an empty string for a tape pool name when this is not
* permitted.
*/
class UserSpecifiedAnEmptyStringTapePoolName: public exception::UserError {
public:
/**
* Constructor.
*
* @param context optional context string added to the message
* at initialisation time.
* @param embedBacktrace whether to embed a backtrace of where the
* exception was throw in the message
*/
UserSpecifiedAnEmptyStringTapePoolName(const std::string &context = "", const bool embedBacktrace = true);
/**
* Destructor.
*/
~UserSpecifiedAnEmptyStringTapePoolName() override;
}; // class UserSpecifiedAnEmptyStringTapePoolName
} // namespace catalogue
} // namespace cta
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "catalogue/UserSpecifiedAnEmptyStringVo.hpp"
namespace cta {
namespace catalogue {
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
UserSpecifiedAnEmptyStringVo::UserSpecifiedAnEmptyStringVo(const std::string &context, const bool embedBacktrace):
cta::exception::UserError(context, embedBacktrace) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
UserSpecifiedAnEmptyStringVo::~UserSpecifiedAnEmptyStringVo() {
}
} // namespace catalogue
} // namespace cta
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* 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
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "common/exception/UserError.hpp"
namespace cta {
namespace catalogue {
/**
* User specified an empty string for a VO when this is not permitted.
*/
class UserSpecifiedAnEmptyStringVo: public exception::UserError {
public:
/**
* Constructor.
*
* @param context optional context string added to the message
* at initialisation time.
* @param embedBacktrace whether to embed a backtrace of where the
* exception was throw in the message
*/
UserSpecifiedAnEmptyStringVo(const std::string &context = "", const bool embedBacktrace = true);
/**
* Destructor.
*/
~UserSpecifiedAnEmptyStringVo() override;
}; // class UserSpecifiedAnEmptyStringVo
} // namespace catalogue
} // namespace cta
......@@ -30,6 +30,7 @@ CREATE TABLE STORAGE_CLASS(
);
CREATE TABLE TAPE_POOL(
TAPE_POOL_NAME VARCHAR2(100) CONSTRAINT TAPE_POOL_TPN_NN NOT NULL,
VO VARCHAR2(100) CONSTRAINT TAPE_POOL_VO_NN NOT NULL,
NB_PARTIAL_TAPES INTEGER CONSTRAINT TAPE_POOL_NPT_NN NOT NULL,
IS_ENCRYPTED INTEGER CONSTRAINT TAPE_POOL_IE_NN NOT NULL,
USER_COMMENT VARCHAR2(1000) CONSTRAINT TAPE_POOL_UC_NN NOT NULL,
......
......@@ -305,7 +305,8 @@ const std::map<std::string, OptionString::Key> strOptions = {
{ "--storageclass", OptionString::STORAGE_CLASS },
{ "--tapepool", OptionString::TAPE_POOL },
{ "--username", OptionString::USERNAME },
{ "--vid", OptionString::VID }
{ "--vid", OptionString::VID },
{ "--vo", OptionString::VO }
};
......@@ -415,6 +416,7 @@ const Option opt_username { Option::OPT_STR, "--username",
const Option opt_username_alias { Option::OPT_STR, "--name", "-n", " <user_name>",
"--username" };
const Option opt_vid { Option::OPT_STR, "--vid", "-v", " <vid>" };
const Option opt_vo { Option::OPT_STR, "--vo", "-v", " <vo>" };
const Option opt_vidfile { Option::OPT_STR_LIST, "--vidfile", "-f", " <filename>" };
const Option opt_full { Option::OPT_BOOL, "--full", "-f", " <\"true\" or \"false\">" };
......@@ -499,9 +501,9 @@ const std::map<cmd_key_t, cmd_val_t> cmdOptions = {
{{ AdminCmd::CMD_TAPE, AdminCmd::SUBCMD_LABEL },
{ opt_vid, opt_force.optional(), opt_lbp.optional() }},
{{ AdminCmd::CMD_TAPEPOOL, AdminCmd::SUBCMD_ADD },
{ opt_tapepool_alias, opt_partialtapes, opt_encrypted, opt_comment }},
{ opt_tapepool_alias, opt_vo, opt_partialtapes, opt_encrypted, opt_comment }},
{{ AdminCmd::CMD_TAPEPOOL, AdminCmd::SUBCMD_CH },
{ opt_tapepool_alias, opt_partialtapes.optional(), opt_encrypted.optional(), opt_comment.optional() }},
{ opt_tapepool_alias, opt_vo.optional(), opt_partialtapes.optional(), opt_encrypted.optional(), opt_comment.optional() }},
{{ AdminCmd::CMD_TAPEPOOL, AdminCmd::SUBCMD_RM }, { opt_tapepool_alias }},
{{ AdminCmd::CMD_TAPEPOOL, AdminCmd::SUBCMD_LS }, { opt_header.optional() }},
{{ AdminCmd::CMD_TEST, AdminCmd::SUBCMD_READ },
......
......@@ -64,6 +64,7 @@ echo "Preparing CTA configuration for tests"
--comment "ctasystest"
kubectl --namespace ${NAMESPACE} exec ctacli -- cta-admin tapepool add \
--name ctasystest \
--vo vo \
--partialtapesnumber 5 \
--encrypted false \
--comment "ctasystest"
......
......@@ -197,9 +197,9 @@ public:
const uint16_t nbPartialTapes = 1;
const std::string tapePoolComment = "Tape-pool comment";
const std::string vo = "vo";
const bool tapePoolEncryption = false;
catalogue.createTapePool(s_adminOnAdminHost, s_tapePoolName,
nbPartialTapes, tapePoolEncryption, tapePoolComment);
catalogue.createTapePool(s_adminOnAdminHost, s_tapePoolName, vo, nbPartialTapes, tapePoolEncryption, tapePoolComment);
const uint16_t copyNb = 1;
const std::string archiveRouteComment = "Archive-route comment";
catalogue.createArchiveRoute(s_adminOnAdminHost, s_diskInstance, s_storageClassName, copyNb, s_tapePoolName,
......
......@@ -295,9 +295,10 @@ public:
const uint16_t nbPartialTapes = 1;
const std::string tapePoolComment = "Tape-pool comment";
const std::string vo = "vo";
const bool tapePoolEncryption = false;
ASSERT_NO_THROW(catalogue.createTapePool(s_adminOnAdminHost, s_tapePoolName,
nbPartialTapes, tapePoolEncryption, tapePoolComment));
ASSERT_NO_THROW(catalogue.createTapePool(s_adminOnAdminHost, s_tapePoolName, vo, nbPartialTapes, tapePoolEncryption,
tapePoolComment));
const uint16_t copyNb = 1;
const std::string archiveRouteComment = "Archive-route comment";
catalogue.createArchiveRoute(s_adminOnAdminHost, s_diskInstance, s_storageClassName, copyNb,