Commit 68360d88 authored by Cedric CAFFY's avatar Cedric CAFFY
Browse files

Created definitive catalogue schema version 2.0

StorageClass now belongs to a VO (madatory)
Adapted unit tests
Modified cta-admin command to set the VO of a Storage Class
parent 80f2f29d
......@@ -75,7 +75,7 @@ CREATE TABLE STORAGE_CLASS(
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,
STORAGE_CLASS_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,
NB_COPIES TINYINT UNSIGNED CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,
VIRTUAL_ORGANIZATION_ID BIGINT UNSIGNED,
VIRTUAL_ORGANIZATION_ID BIGINT UNSIGNED CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,
......
......@@ -101,7 +101,7 @@ CREATE TABLE STORAGE_CLASS(
DISK_INSTANCE_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,
STORAGE_CLASS_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,
NB_COPIES NUMERIC(3, 0) CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,
VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0),
VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL,
USER_COMMENT VARCHAR2(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,
......
......@@ -85,7 +85,7 @@ CREATE TABLE STORAGE_CLASS(
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,
STORAGE_CLASS_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,
NB_COPIES NUMERIC(3, 0) CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,
VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0),
VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,
......
......@@ -65,7 +65,7 @@ CREATE TABLE STORAGE_CLASS(
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,
STORAGE_CLASS_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,
NB_COPIES INTEGER CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,
VIRTUAL_ORGANIZATION_ID INTEGER,
VIRTUAL_ORGANIZATION_ID INTEGER CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,
......
......@@ -2569,7 +2569,7 @@ namespace catalogue{
" DISK_INSTANCE_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,"
" STORAGE_CLASS_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,"
" NB_COPIES NUMERIC(3, 0) CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,"
" VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0), "
" VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL, "
" USER_COMMENT VARCHAR2(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR2(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,"
......@@ -2894,7 +2894,7 @@ namespace catalogue{
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,"
" STORAGE_CLASS_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,"
" NB_COPIES TINYINT UNSIGNED CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,"
" VIRTUAL_ORGANIZATION_ID BIGINT UNSIGNED, "
" VIRTUAL_ORGANIZATION_ID BIGINT UNSIGNED CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL, "
" USER_COMMENT VARCHAR(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,"
......@@ -3208,7 +3208,7 @@ namespace catalogue{
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,"
" STORAGE_CLASS_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,"
" NB_COPIES INTEGER CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,"
" VIRTUAL_ORGANIZATION_ID INTEGER, "
" VIRTUAL_ORGANIZATION_ID INTEGER CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL, "
" USER_COMMENT VARCHAR(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,"
......@@ -3540,7 +3540,7 @@ namespace catalogue{
" DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,"
" STORAGE_CLASS_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,"
" NB_COPIES NUMERIC(3, 0) CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,"
" VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0), "
" VIRTUAL_ORGANIZATION_ID NUMERIC(20, 0) CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL, "
" USER_COMMENT VARCHAR(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,"
" CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,"
" CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,"
......
......@@ -281,6 +281,7 @@ public:
virtual std::list<common::dataStructures::StorageClass> getStorageClasses() const = 0;
virtual void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbCopies) = 0;
virtual void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0;
virtual void modifyStorageClassVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) = 0;
/**
* Modifies the name of the specified storage class.
......
......@@ -159,6 +159,10 @@ public:
void modifyStorageClassName(const common::dataStructures::SecurityIdentity &admin, const std::string &currentName, const std::string &newName) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassName(admin, currentName, newName);}, m_maxTriesToConnect);
}
void modifyStorageClassVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyStorageClassVo(admin, name, vo);}, 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 cta::optional<std::string> &supply, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createTapePool(admin, name, vo, nbPartialTapes, encryptionValue, supply, comment);}, m_maxTriesToConnect);
......
This diff is collapsed.
......@@ -109,6 +109,7 @@ public:
void modifyRequesterGroupMountRulePolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& requesterGroupName, const std::string& mountPolicy) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyRequesterMountRulePolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& requesterName, const std::string& mountPolicy) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyStorageClassComment(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 modifyStorageClassVo(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 modifyStorageClassName(const common::dataStructures::SecurityIdentity& admin, const std::string& currentName, const std::string& newName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t nbCopies) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void modifyTapeCapacityInBytes(const common::dataStructures::SecurityIdentity& admin, const std::string& vid, const uint64_t capacityInBytes) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
......
......@@ -579,12 +579,22 @@ void RdbmsCatalogue::createStorageClass(
if(storageClass.comment.empty()) {
throw UserSpecifiedAnEmptyStringComment("Cannot create storage class because the comment is an empty string");
}
std::string vo = storageClass.vo.name;
if(vo.empty()) {
throw UserSpecifiedAnEmptyStringVo("Cannot create storage class because the vo is an empty string");
}
auto conn = m_connPool.getConn();
if(storageClassExists(conn, storageClass.name)) {
throw exception::UserError(std::string("Cannot create storage class : ") +
storageClass.name + " because it already exists");
}
if(!virtualOrganizationExists(conn,vo)){
throw exception::UserError(std::string("Cannot create storage class : ") +
storageClass.name + " because the vo : " + vo + " does not exist");
}
const uint64_t storageClassId = getNextStorageClassId(conn);
const time_t now = time(nullptr);
const char *const sql =
......@@ -593,6 +603,7 @@ void RdbmsCatalogue::createStorageClass(
"DISK_INSTANCE_NAME,"
"STORAGE_CLASS_NAME,"
"NB_COPIES,"
"VIRTUAL_ORGANIZATION_ID,"
"USER_COMMENT,"
......@@ -608,6 +619,7 @@ void RdbmsCatalogue::createStorageClass(
":DISK_INSTANCE_NAME,"
":STORAGE_CLASS_NAME,"
":NB_COPIES,"
"(SELECT VIRTUAL_ORGANIZATION_ID FROM VIRTUAL_ORGANIZATION WHERE VIRTUAL_ORGANIZATION_NAME = :VO),"
":USER_COMMENT,"
......@@ -624,7 +636,8 @@ void RdbmsCatalogue::createStorageClass(
stmt.bindString(":DISK_INSTANCE_NAME", storageClass.diskInstance);
stmt.bindString(":STORAGE_CLASS_NAME", storageClass.name);
stmt.bindUint64(":NB_COPIES", storageClass.nbCopies);
stmt.bindString(":VO",vo);
stmt.bindString(":USER_COMMENT", storageClass.comment);
stmt.bindString(":CREATION_LOG_USER_NAME", admin.username);
......@@ -831,18 +844,21 @@ std::list<common::dataStructures::StorageClass> RdbmsCatalogue::getStorageClasse
"DISK_INSTANCE_NAME AS DISK_INSTANCE_NAME,"
"STORAGE_CLASS_NAME AS STORAGE_CLASS_NAME,"
"NB_COPIES AS NB_COPIES,"
"VIRTUAL_ORGANIZATION.VIRTUAL_ORGANIZATION_NAME AS VIRTUAL_ORGANIZATION_NAME,"
"USER_COMMENT AS USER_COMMENT,"
"STORAGE_CLASS.USER_COMMENT AS USER_COMMENT,"
"CREATION_LOG_USER_NAME AS CREATION_LOG_USER_NAME,"
"CREATION_LOG_HOST_NAME AS CREATION_LOG_HOST_NAME,"
"CREATION_LOG_TIME AS CREATION_LOG_TIME,"
"STORAGE_CLASS.CREATION_LOG_USER_NAME AS CREATION_LOG_USER_NAME,"
"STORAGE_CLASS.CREATION_LOG_HOST_NAME AS CREATION_LOG_HOST_NAME,"
"STORAGE_CLASS.CREATION_LOG_TIME AS CREATION_LOG_TIME,"
"LAST_UPDATE_USER_NAME AS LAST_UPDATE_USER_NAME,"
"LAST_UPDATE_HOST_NAME AS LAST_UPDATE_HOST_NAME,"
"LAST_UPDATE_TIME AS LAST_UPDATE_TIME "
"STORAGE_CLASS.LAST_UPDATE_USER_NAME AS LAST_UPDATE_USER_NAME,"
"STORAGE_CLASS.LAST_UPDATE_HOST_NAME AS LAST_UPDATE_HOST_NAME,"
"STORAGE_CLASS.LAST_UPDATE_TIME AS LAST_UPDATE_TIME "
"FROM "
"STORAGE_CLASS "
"INNER JOIN "
"VIRTUAL_ORGANIZATION ON STORAGE_CLASS.VIRTUAL_ORGANIZATION_ID = VIRTUAL_ORGANIZATION.VIRTUAL_ORGANIZATION_ID "
"ORDER BY "
"DISK_INSTANCE_NAME, STORAGE_CLASS_NAME";
auto conn = m_connPool.getConn();
......@@ -854,6 +870,7 @@ std::list<common::dataStructures::StorageClass> RdbmsCatalogue::getStorageClasse
storageClass.diskInstance = rset.columnString("DISK_INSTANCE_NAME");
storageClass.name = rset.columnString("STORAGE_CLASS_NAME");
storageClass.nbCopies = rset.columnUint64("NB_COPIES");
storageClass.vo.name = rset.columnString("VIRTUAL_ORGANIZATION_NAME");
storageClass.comment = rset.columnString("USER_COMMENT");
storageClass.creationLog.username = rset.columnString("CREATION_LOG_USER_NAME");
storageClass.creationLog.host = rset.columnString("CREATION_LOG_HOST_NAME");
......@@ -946,6 +963,45 @@ void RdbmsCatalogue::modifyStorageClassComment(const common::dataStructures::Sec
}
}
void RdbmsCatalogue::modifyStorageClassVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo){
try {
const time_t now = time(nullptr);
const char *const sql =
"UPDATE STORAGE_CLASS SET "
"VIRTUAL_ORGANIZATION_ID = (SELECT VIRTUAL_ORGANIZATION_ID FROM VIRTUAL_ORGANIZATION WHERE VIRTUAL_ORGANIZATION_NAME = :VO),"
"LAST_UPDATE_USER_NAME = :LAST_UPDATE_USER_NAME,"
"LAST_UPDATE_HOST_NAME = :LAST_UPDATE_HOST_NAME,"
"LAST_UPDATE_TIME = :LAST_UPDATE_TIME "
"WHERE "
"STORAGE_CLASS_NAME = :STORAGE_CLASS_NAME";
auto conn = m_connPool.getConn();
if(vo.empty()){
throw UserSpecifiedAnEmptyStringVo(std::string("Cannot modify the vo of the storage class : ") + name + " because the vo is an empty string");
}
if(!virtualOrganizationExists(conn,vo)){
throw exception::UserError(std::string("Cannot modify storage class : ") + name +
" because the vo " + vo + " does not exist");
}
auto stmt = conn.createStmt(sql);
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(":STORAGE_CLASS_NAME", name);
stmt.executeNonQuery();
if(0 == stmt.getNbAffectedRows()) {
throw exception::UserError(std::string("Cannot modify storage class : ") + name +
" because it does not exist");
}
} catch(exception::UserError &) {
throw;
} catch(exception::Exception &ex) {
ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str());
throw;
}
}
//------------------------------------------------------------------------------
// modifyStorageClassName
//------------------------------------------------------------------------------
......
......@@ -268,7 +268,7 @@ public:
std::list<common::dataStructures::StorageClass> getStorageClasses() const override;
void modifyStorageClassNbCopies(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t nbCopies) override;
void modifyStorageClassComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override;
void modifyStorageClassVo(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &vo) override;
/**
* Modifies the name of the specified storage class.
*
......@@ -1193,7 +1193,6 @@ protected:
/**
* The name of the storage class which is only guaranteed to be unique
* within its disk instance.
*/
std::string storageClassName;
......
......@@ -50,7 +50,7 @@ CREATE TABLE STORAGE_CLASS(
DISK_INSTANCE_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_DIN_NN NOT NULL,
STORAGE_CLASS_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_SCN_NN NOT NULL,
NB_COPIES UINT8TYPE CONSTRAINT STORAGE_CLASS_NC_NN NOT NULL,
VIRTUAL_ORGANIZATION_ID UINT64TYPE,
VIRTUAL_ORGANIZATION_ID UINT64TYPE CONSTRAINT STORAGE_CLASS_VOI_NN NOT NULL,
USER_COMMENT VARCHAR(1000) CONSTRAINT STORAGE_CLASS_UC_NN NOT NULL,
CREATION_LOG_USER_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLUN_NN NOT NULL,
CREATION_LOG_HOST_NAME VARCHAR(100) CONSTRAINT STORAGE_CLASS_CLHN_NN NOT NULL,
......
......@@ -560,10 +560,10 @@ const std::map<cmd_key_t, cmd_val_t> cmdOptions = {
{{ AdminCmd::CMD_SHOWQUEUES, AdminCmd::SUBCMD_NONE }, { }},
/*----------------------------------------------------------------------------------------------------*/
{{ AdminCmd::CMD_STORAGECLASS, AdminCmd::SUBCMD_ADD },
{ opt_instance, opt_storageclass_alias, opt_copynb, opt_comment }},
{ opt_instance, opt_storageclass_alias, opt_copynb, opt_vo ,opt_comment }},
{{ AdminCmd::CMD_STORAGECLASS, AdminCmd::SUBCMD_CH },
{ opt_instance, opt_storageclass_alias, opt_copynb.optional(), opt_comment.optional() }},
{{ AdminCmd::CMD_STORAGECLASS, AdminCmd::SUBCMD_RM }, { opt_instance, opt_storageclass_alias }},
{ opt_storageclass_alias, opt_copynb.optional(), opt_vo.optional(), opt_comment.optional() }},
{{ AdminCmd::CMD_STORAGECLASS, AdminCmd::SUBCMD_RM }, { opt_storageclass_alias }},
{{ AdminCmd::CMD_STORAGECLASS, AdminCmd::SUBCMD_LS }, { }},
/*----------------------------------------------------------------------------------------------------*/
{{ AdminCmd::CMD_TAPE, AdminCmd::SUBCMD_ADD },
......
......@@ -750,6 +750,7 @@ void TextFormatter::printStorageClassLsHeader() {
"instance",
"storage class",
"number of copies",
"vo",
"c.user",
"c.host",
"c.time",
......@@ -765,6 +766,7 @@ void TextFormatter::print(const StorageClassLsItem &scls_item) {
scls_item.disk_instance(),
scls_item.name(),
scls_item.nb_copies(),
scls_item.vo(),
scls_item.creation_log().username(),
scls_item.creation_log().host(),
timeToStr(scls_item.creation_log().time()),
......
......@@ -51,6 +51,7 @@ std::ostream &operator<<(std::ostream &os, const StorageClass &obj) {
os << "(diskInstance=" << obj.diskInstance
<< " name=" << obj.name
<< " nbCopies=" << obj.nbCopies
<< " vo=" << obj.vo.name
<< " creationLog=" << obj.creationLog
<< " lastModificationLog=" << obj.lastModificationLog
<< " comment=" << obj.comment << ")";
......
......@@ -24,6 +24,7 @@
#include <string>
#include "common/dataStructures/EntryLog.hpp"
#include "VirtualOrganization.hpp"
namespace cta {
namespace common {
......@@ -72,9 +73,6 @@ struct StorageClass {
/**
* The name of the disk instance to which the storage class belongs.
*
* Please note that the name of a storage class is only gauranteed to be
* unique within its disk instance.
*/
std::string diskInstance;
......@@ -90,6 +88,11 @@ struct StorageClass {
* The number of copies on tape.
*/
uint64_t nbCopies;
/**
* The virtual organization to which this storage class belongs
*/
VirtualOrganization vo;
/**
* The creation log.
......
......@@ -130,6 +130,7 @@ echo "Preparing CTA configuration for tests"
--instance ${EOSINSTANCE} \
--name ctaStorageClass \
--copynb 1 \
--vo vo \
--comment "ctasystest"
kubectl --namespace ${NAMESPACE} exec ctacli -- cta-admin archiveroute add \
--instance ${EOSINSTANCE} \
......
......@@ -326,10 +326,9 @@ repackMoveAndAddCopies() {
echo "OK"
storageClassName=`kubectl -n ${NAMESPACE} exec ctacli -- cta-admin --json storageclass ls | jq -r ". [0] | .name"`
instanceName=`kubectl -n ${NAMESPACE} exec ctacli -- cta-admin --json storageclass ls | jq -r ". [0] | .diskInstance"`
echo "Changing the storage class $storageClassName nb copies"
kubectl -n ${NAMESPACE} exec ctacli -- cta-admin storageclass ch --instance $instanceName --name $storageClassName --copynb 3
kubectl -n ${NAMESPACE} exec ctacli -- cta-admin storageclass ch --name $storageClassName --copynb 3
echo "OK"
echo "Putting all drives up"
......
......@@ -208,19 +208,21 @@ public:
ASSERT_EQ(s_adminOnAdminHost.host, rule.creationLog.host);
ASSERT_EQ(rule.creationLog, rule.lastModificationLog);
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.comment = "comment";
m_catalogue->createVirtualOrganization(s_adminOnAdminHost,vo);
common::dataStructures::StorageClass storageClass;
storageClass.diskInstance = s_diskInstance;
storageClass.name = s_storageClassName;
storageClass.nbCopies = 1;
storageClass.vo.name = vo.name;
storageClass.comment = "create storage class";
m_catalogue->createStorageClass(s_adminOnAdminHost, storageClass);
const uint16_t nbPartialTapes = 1;
const std::string tapePoolComment = "Tape-pool comment";
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.comment = "comment";
m_catalogue->createVirtualOrganization(s_adminOnAdminHost,vo);
const bool tapePoolEncryption = false;
const cta::optional<std::string> tapePoolSupply("value for the supply pool mechanism");
catalogue.createTapePool(s_adminOnAdminHost, s_tapePoolName, vo.name, nbPartialTapes, tapePoolEncryption, tapePoolSupply,
......
......@@ -288,19 +288,21 @@ public:
ASSERT_EQ(s_adminOnAdminHost.host, rule.creationLog.host);
ASSERT_EQ(rule.creationLog, rule.lastModificationLog);
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.comment = "comment";
catalogue.createVirtualOrganization(s_adminOnAdminHost,vo);
common::dataStructures::StorageClass storageClass;
storageClass.diskInstance = s_diskInstance;
storageClass.name = s_storageClassName;
storageClass.nbCopies = 1;
storageClass.vo.name = vo.name;
storageClass.comment = "create storage class";
m_catalogue->createStorageClass(s_adminOnAdminHost, storageClass);
const uint16_t nbPartialTapes = 1;
const std::string tapePoolComment = "Tape-pool comment";
cta::common::dataStructures::VirtualOrganization vo;
vo.name = "vo";
vo.comment = "comment";
catalogue.createVirtualOrganization(s_adminOnAdminHost,vo);
const bool tapePoolEncryption = false;
const cta::optional<std::string> tapePoolSupply("value for the supply pool mechanism");
......
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