Commit 2abe00fe authored by Cedric Caffy's avatar Cedric Caffy
Browse files

[catalogue] Created a catalogue::CreateMountPolicyAttributes object and added...

[catalogue] Created a catalogue::CreateMountPolicyAttributes object and added the maxDrivesAllowedPerVo field
parent 9a9cbd10
......@@ -70,6 +70,7 @@
#include "common/optional.hpp"
#include "disk/DiskSystem.hpp"
#include "RecyleTapeFileSearchCriteria.hpp"
#include "CreateMountPolicyAttributes.hpp"
#include <list>
#include <map>
......@@ -656,15 +657,7 @@ public:
virtual void modifyRequesterGroupMountRulePolicy(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &requesterGroupName, const std::string &mountPolicy) = 0;
virtual void modifyRequesterGroupMountRuleComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &requesterGroupName, const std::string &comment) = 0;
virtual void createMountPolicy(
const common::dataStructures::SecurityIdentity &admin,
const std::string &name,
const uint64_t archivePriority,
const uint64_t minArchiveRequestAge,
const uint64_t retrievePriority,
const uint64_t minRetrieveRequestAge,
const uint64_t maxDrivesAllowed,
const std::string &comment) = 0;
virtual void createMountPolicy(const common::dataStructures::SecurityIdentity &admin, const CreateMountPolicyAttributes & mountPolicy) = 0;
/**
* Returns the list of all existing mount policies.
......
......@@ -396,8 +396,8 @@ public:
return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyRequesterGroupMountRuleComment(admin, instanceName, requesterGroupName, comment);}, m_maxTriesToConnect);
}
void createMountPolicy(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t archivePriority, const uint64_t minArchiveRequestAge, const uint64_t retrievePriority, const uint64_t minRetrieveRequestAge, const uint64_t maxDrivesAllowed, const std::string &comment) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createMountPolicy(admin, name, archivePriority, minArchiveRequestAge, retrievePriority, minRetrieveRequestAge, maxDrivesAllowed, comment);}, m_maxTriesToConnect);
void createMountPolicy(const common::dataStructures::SecurityIdentity &admin, const CreateMountPolicyAttributes & mountPolicy) override {
return retryOnLostConnection(m_log, [&]{return m_catalogue->createMountPolicy(admin, mountPolicy);}, m_maxTriesToConnect);
}
std::list<common::dataStructures::MountPolicy> getMountPolicies() const override {
......
This diff is collapsed.
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2019 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/optional.hpp"
#include "common/dataStructures/Tape.hpp"
#include <string>
namespace cta {
namespace catalogue {
struct CreateMountPolicyAttributes {
std::string name;
uint64_t archivePriority;
uint64_t minArchiveRequestAge;
uint64_t retrievePriority;
uint64_t minRetrieveRequestAge;
uint64_t maxDrivesAllowed;
uint64_t maxDrivesAllowedPerVo;
std::string comment;
};
}}
\ No newline at end of file
......@@ -38,7 +38,7 @@ public:
void createAdminUser(const common::dataStructures::SecurityIdentity& admin, const std::string& username, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createArchiveRoute(const common::dataStructures::SecurityIdentity& admin, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createLogicalLibrary(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const bool isDisabled, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createMountPolicy(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t archivePriority, const uint64_t minArchiveRequestAge, const uint64_t retrievePriority, const uint64_t minRetrieveRequestAge, const uint64_t maxDrivesAllowed, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createMountPolicy(const common::dataStructures::SecurityIdentity& admin, const CreateMountPolicyAttributes & mountPolicy) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
void createRequesterGroupMountRule(const common::dataStructures::SecurityIdentity& admin, const std::string& mountPolicyName, const std::string& diskInstanceName, const std::string& requesterGroupName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); }
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"); }
......
......@@ -4931,15 +4931,8 @@ void RdbmsCatalogue::modifyRequesterGroupMountRuleComment(const common::dataStru
//------------------------------------------------------------------------------
// createMountPolicy
//------------------------------------------------------------------------------
void RdbmsCatalogue::createMountPolicy(
const common::dataStructures::SecurityIdentity &admin,
const std::string &name,
const uint64_t archivePriority,
const uint64_t minArchiveRequestAge,
const uint64_t retrievePriority,
const uint64_t minRetrieveRequestAge,
const uint64_t maxDrivesAllowed,
const std::string &comment) {
void RdbmsCatalogue::createMountPolicy(const common::dataStructures::SecurityIdentity &admin, const CreateMountPolicyAttributes & mountPolicy) {
std::string name = mountPolicy.name;
try {
auto conn = m_connPool.getConn();
if(mountPolicyExists(conn, name)) {
......@@ -4958,6 +4951,7 @@ void RdbmsCatalogue::createMountPolicy(
"RETRIEVE_MIN_REQUEST_AGE,"
"MAX_DRIVES_ALLOWED,"
"MAX_DRIVES_ALLOWED_PER_VO,"
"USER_COMMENT,"
......@@ -4978,6 +4972,7 @@ void RdbmsCatalogue::createMountPolicy(
":RETRIEVE_MIN_REQUEST_AGE,"
":MAX_DRIVES_ALLOWED,"
":MAX_DRIVES_ALLOWED_PER_VO,"
":USER_COMMENT,"
......@@ -4992,15 +4987,16 @@ void RdbmsCatalogue::createMountPolicy(
stmt.bindString(":MOUNT_POLICY_NAME", name);
stmt.bindUint64(":ARCHIVE_PRIORITY", archivePriority);
stmt.bindUint64(":ARCHIVE_MIN_REQUEST_AGE", minArchiveRequestAge);
stmt.bindUint64(":ARCHIVE_PRIORITY", mountPolicy.archivePriority);
stmt.bindUint64(":ARCHIVE_MIN_REQUEST_AGE", mountPolicy.minArchiveRequestAge);
stmt.bindUint64(":RETRIEVE_PRIORITY", retrievePriority);
stmt.bindUint64(":RETRIEVE_MIN_REQUEST_AGE", minRetrieveRequestAge);
stmt.bindUint64(":MAX_DRIVES_ALLOWED", maxDrivesAllowed);
stmt.bindUint64(":RETRIEVE_PRIORITY", mountPolicy.retrievePriority);
stmt.bindUint64(":RETRIEVE_MIN_REQUEST_AGE", mountPolicy.minRetrieveRequestAge);
stmt.bindString(":USER_COMMENT", comment);
stmt.bindUint64(":MAX_DRIVES_ALLOWED", mountPolicy.maxDrivesAllowed);
stmt.bindUint64(":MAX_DRIVES_ALLOWED_PER_VO",mountPolicy.maxDrivesAllowedPerVo);
stmt.bindString(":USER_COMMENT", mountPolicy.comment);
stmt.bindString(":CREATION_LOG_USER_NAME", admin.username);
stmt.bindString(":CREATION_LOG_HOST_NAME", admin.host);
......@@ -5570,6 +5566,7 @@ optional<common::dataStructures::MountPolicy> RdbmsCatalogue::getRequesterMountP
policy.retrieveMinRequestAge = rset.columnUint64("RETRIEVE_MIN_REQUEST_AGE");
policy.maxDrivesAllowed = rset.columnUint64("MAX_DRIVES_ALLOWED");
policy.maxDrivesAllowedPerVo = rset.columnUint64("MAX_DRIVES_ALLOWED_PER_VO");
policy.comment = rset.columnString("USER_COMMENT");
......@@ -5680,6 +5677,7 @@ try {
"RETRIEVE_MIN_REQUEST_AGE AS RETRIEVE_MIN_REQUEST_AGE,"
"MAX_DRIVES_ALLOWED AS MAX_DRIVES_ALLOWED,"
"MAX_DRIVES_ALLOWED_PER_VO AS MAX_DRIVES_ALLOWED_PER_VO,"
"USER_COMMENT AS USER_COMMENT,"
......
......@@ -609,15 +609,7 @@ public:
void modifyRequesterGroupMountRulePolicy(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &requesterGroupName, const std::string &mountPolicy) override;
void modifyRequesterGroupMountRuleComment(const common::dataStructures::SecurityIdentity &admin, const std::string &instanceName, const std::string &requesterGroupName, const std::string &comment) override;
void createMountPolicy(
const common::dataStructures::SecurityIdentity &admin,
const std::string &name,
const uint64_t archivePriority,
const uint64_t minArchiveRequestAge,
const uint64_t retrievePriority,
const uint64_t minRetrieveRequestAge,
const uint64_t maxDrivesAllowed,
const std::string &comment) override;
void createMountPolicy(const common::dataStructures::SecurityIdentity &admin, const CreateMountPolicyAttributes & mountPolicy) override;
/**
* Returns the list of all existing mount policies.
......
......@@ -33,12 +33,13 @@ MountPolicy::MountPolicy():
archiveMinRequestAge(0),
retrievePriority(0),
retrieveMinRequestAge(0),
maxDrivesAllowed(0) {}
maxDrivesAllowed(0),
maxDrivesAllowedPerVo(0){}
MountPolicy::MountPolicy(const std::string name, const uint64_t archivePriority,const uint64_t archiveMinRequestAge, const uint64_t retrievePriority,
const uint64_t retrieveMinRequestAge, const uint64_t maxDrivesAllowed):
const uint64_t retrieveMinRequestAge, const uint64_t maxDrivesAllowed, const uint64_t maxDrivesAllowedPerVo):
name(name), archivePriority(archivePriority), archiveMinRequestAge(archiveMinRequestAge), retrievePriority(retrievePriority),
retrieveMinRequestAge(retrieveMinRequestAge), maxDrivesAllowed(maxDrivesAllowed) {}
retrieveMinRequestAge(retrieveMinRequestAge), maxDrivesAllowed(maxDrivesAllowed), maxDrivesAllowedPerVo(maxDrivesAllowedPerVo) {}
//------------------------------------------------------------------------------
// operator==
//------------------------------------------------------------------------------
......@@ -49,6 +50,7 @@ bool MountPolicy::operator==(const MountPolicy &rhs) const {
&& retrievePriority==rhs.retrievePriority
&& retrieveMinRequestAge==rhs.retrieveMinRequestAge
&& maxDrivesAllowed==rhs.maxDrivesAllowed
&& maxDrivesAllowedPerVo==rhs.maxDrivesAllowedPerVo
&& creationLog==rhs.creationLog
&& lastModificationLog==rhs.lastModificationLog
&& comment==rhs.comment;
......@@ -69,6 +71,7 @@ MountPolicy MountPolicy::operator=(const MountPolicy& other){
this->creationLog = other.creationLog;
this->lastModificationLog = other.lastModificationLog;
this->maxDrivesAllowed = other.maxDrivesAllowed;
this->maxDrivesAllowedPerVo = other.maxDrivesAllowedPerVo;
this->name = other.name;
this->retrieveMinRequestAge = other.retrieveMinRequestAge;
this->retrievePriority = other.retrievePriority;
......@@ -85,13 +88,14 @@ std::ostream &operator<<(std::ostream &os, const MountPolicy &obj) {
<< " retrieve_priority=" << obj.retrievePriority
<< " retrieve_minRequestAge=" << obj.retrieveMinRequestAge
<< " maxDrivesAllowed=" << obj.maxDrivesAllowed
<< " maxDrivesAllowedPerVo=" << obj.maxDrivesAllowedPerVo
<< " creationLog=" << obj.creationLog
<< " lastModificationLog=" << obj.lastModificationLog
<< " comment=" << obj.comment << ")";
return os;
}
MountPolicy MountPolicy::s_defaultMountPolicyForRepack("default_mount_policy_repack",1,1,1,1,1);
MountPolicy MountPolicy::s_defaultMountPolicyForRepack("default_mount_policy_repack",1,1,1,1,1,1);
} // namespace dataStructures
} // namespace common
......
......@@ -48,6 +48,7 @@ struct MountPolicy {
uint64_t retrievePriority;
uint64_t retrieveMinRequestAge;
uint64_t maxDrivesAllowed;
uint64_t maxDrivesAllowedPerVo;
EntryLog creationLog;
EntryLog lastModificationLog;
std::string comment;
......@@ -56,7 +57,7 @@ struct MountPolicy {
static struct MountPolicy s_defaultMountPolicyForRepack;
private:
MountPolicy(const std::string name,const uint64_t archivePriority,const uint64_t archiveMinRequestAge, const uint64_t retrievePriority, const uint64_t retrieveMinRequestAge, const uint64_t maxDrivesAllowed);
MountPolicy(const std::string name,const uint64_t archivePriority,const uint64_t archiveMinRequestAge, const uint64_t retrievePriority, const uint64_t retrieveMinRequestAge, const uint64_t maxDrivesAllowed, const uint64_t maxDrivesAllowedPerVo);
}; // struct MountPolicy
......
......@@ -43,6 +43,7 @@ public:
osmp.set_retrievepriority(retrievePriority);
osmp.set_retieveminrequestage(retrieveMinRequestAge);
osmp.set_maxdrivesallowed(maxDrivesAllowed);
osmp.set_max_drives_allowed_per_vo(maxDrivesAllowedPerVo);
EntryLogSerDeser(creationLog).serialize(*osmp.mutable_creationlog());
EntryLogSerDeser(lastModificationLog).serialize(*osmp.mutable_lastmodificationlog());
osmp.set_comment(comment);
......@@ -54,6 +55,7 @@ public:
retrievePriority=osmp.retrievepriority();
retrieveMinRequestAge=osmp.retieveminrequestage();
maxDrivesAllowed=osmp.maxdrivesallowed();
maxDrivesAllowedPerVo=osmp.max_drives_allowed_per_vo();
EntryLogSerDeser el;
el.deserialize(osmp.creationlog());
creationLog=el;
......
......@@ -300,6 +300,7 @@ message MountPolicy {
required EntryLog creationlog = 8986;
required EntryLog lastmodificationlog = 8987;
required string comment = 8988;
optional uint64 max_drives_allowed_per_vo = 8989;
}
// ------------- Archive Jobs --------------------------------------------------
......
......@@ -168,19 +168,24 @@ public:
const uint64_t retrievePriority = s_retrievePriority;
const uint64_t minRetrieveRequestAge = s_minRetrieveRequestAge;
const uint64_t maxDrivesAllowed = s_maxDrivesAllowed;
const uint64_t maxDrivesAllowedPerVo = s_maxDrivesAllowedPerVo;
const std::string mountPolicyComment = "create mount group";
catalogue::CreateMountPolicyAttributes mountPolicy;
mountPolicy.name = mountPolicyName;
mountPolicy.archivePriority = archivePriority;
mountPolicy.minArchiveRequestAge = minArchiveRequestAge;
mountPolicy.retrievePriority = retrievePriority;
mountPolicy.minRetrieveRequestAge = minRetrieveRequestAge;
mountPolicy.maxDrivesAllowed = maxDrivesAllowed;
mountPolicy.maxDrivesAllowedPerVo = maxDrivesAllowedPerVo;
mountPolicy.comment = mountPolicyComment;
ASSERT_TRUE(catalogue.getMountPolicies().empty());
catalogue.createMountPolicy(
s_adminOnAdminHost,
mountPolicyName,
archivePriority,
minArchiveRequestAge,
retrievePriority,
minRetrieveRequestAge,
maxDrivesAllowed,
mountPolicyComment);
mountPolicy);
const std::list<common::dataStructures::MountPolicy> groups = catalogue.getMountPolicies();
ASSERT_EQ(1, groups.size());
......@@ -289,6 +294,7 @@ protected:
const uint64_t s_retrievePriority = 3;
const uint64_t s_minRetrieveRequestAge = 4;
const uint64_t s_maxDrivesAllowed = 50;
const uint64_t s_maxDrivesAllowedPerVo = 50;
const uint64_t s_mediaTypeCapacityInBytes = 10;
const std::string s_vo = "vo";
//TempFile m_tempSqliteFile;
......
......@@ -252,29 +252,52 @@ public:
return tape;
}
cta::catalogue::CreateMountPolicyAttributes getDefaultMountPolicy() {
cta::catalogue::CreateMountPolicyAttributes mountPolicy;
mountPolicy.name = "mount_group";
mountPolicy.archivePriority = 1;
mountPolicy.minArchiveRequestAge = 2;
mountPolicy.retrievePriority = 3;
mountPolicy.minRetrieveRequestAge = 4;
mountPolicy.maxDrivesAllowed = 5;
mountPolicy.maxDrivesAllowedPerVo = 6;
mountPolicy.comment = "create mount group";
return mountPolicy;
}
cta::catalogue::CreateMountPolicyAttributes getImmediateMountMountPolicy() {
cta::catalogue::CreateMountPolicyAttributes mountPolicy;
mountPolicy.name = "immediateMount";
mountPolicy.archivePriority = 1000;
mountPolicy.minArchiveRequestAge = 0;
mountPolicy.retrievePriority = 1000;
mountPolicy.minRetrieveRequestAge = 0;
mountPolicy.maxDrivesAllowed = 1;
mountPolicy.maxDrivesAllowedPerVo = 1;
mountPolicy.comment = "Immediate mount";
return mountPolicy;
}
void setupDefaultCatalogue() {
using namespace cta;
auto & catalogue=getCatalogue();
const std::string mountPolicyName = "mount_group";
const uint64_t archivePriority = 1;
const uint64_t minArchiveRequestAge = 2;
const uint64_t retrievePriority = 3;
const uint64_t minRetrieveRequestAge = 4;
const uint64_t maxDrivesAllowed = 5;
auto mountPolicy = getDefaultMountPolicy();
const std::string mountPolicyName = mountPolicy.name;
const uint64_t archivePriority = mountPolicy.archivePriority;
const uint64_t minArchiveRequestAge = mountPolicy.minArchiveRequestAge;
const uint64_t retrievePriority = mountPolicy.retrievePriority;
const uint64_t minRetrieveRequestAge = mountPolicy.minRetrieveRequestAge;
const uint64_t maxDrivesAllowed = mountPolicy.maxDrivesAllowed;
const uint64_t maxDrivesAllowedPerVo = mountPolicy.maxDrivesAllowedPerVo;
const std::string mountPolicyComment = "create mount group";
ASSERT_TRUE(catalogue.getMountPolicies().empty());
catalogue.createMountPolicy(
s_adminOnAdminHost,
mountPolicyName,
archivePriority,
minArchiveRequestAge,
retrievePriority,
minRetrieveRequestAge,
maxDrivesAllowed,
mountPolicyComment);
mountPolicy);
const std::list<common::dataStructures::MountPolicy> groups = catalogue.getMountPolicies();
ASSERT_EQ(1, groups.size());
......@@ -285,6 +308,7 @@ public:
ASSERT_EQ(retrievePriority, group.retrievePriority);
ASSERT_EQ(minRetrieveRequestAge, group.retrieveMinRequestAge);
ASSERT_EQ(maxDrivesAllowed, group.maxDrivesAllowed);
ASSERT_EQ(maxDrivesAllowedPerVo,group.maxDrivesAllowedPerVo);
ASSERT_EQ(mountPolicyComment, group.comment);
const std::string ruleComment = "create requester mount-rule";
......@@ -1882,8 +1906,10 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayMigration) {
}
// Create the mount criteria
catalogue.createMountPolicy(requester, "immediateMount", 1000, 0, 1000, 0, 1, "Policy comment");
catalogue.createRequesterMountRule(requester, "immediateMount", s_diskInstance, requester.username, "Rule comment");
auto mountPolicy = getImmediateMountMountPolicy();
catalogue.createMountPolicy(requester, mountPolicy);
std::string mountPolicyName = mountPolicy.name;
catalogue.createRequesterMountRule(requester, mountPolicyName, s_diskInstance, requester.username, "Rule comment");
//delete is unnecessary
//pointer with ownership will be passed to the application,
......@@ -2029,8 +2055,10 @@ TEST_P(DataTransferSessionTest, DataTransferSessionMissingFilesMigration) {
}
// Create the mount criteria
catalogue.createMountPolicy(requester, "immediateMount", 1000, 0, 1000, 0, 1, "Policy comment");
catalogue.createRequesterMountRule(requester, "immediateMount", s_diskInstance, requester.username, "Rule comment");
auto mountPolicy = getImmediateMountMountPolicy();
catalogue.createMountPolicy(requester, mountPolicy);
std::string mountPolicyName = mountPolicy.name;
catalogue.createRequesterMountRule(requester, mountPolicyName, s_diskInstance, requester.username, "Rule comment");
//delete is unnecessary
//pointer with ownership will be passed to the application,
......@@ -2190,9 +2218,10 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullMigration) {
catalogue.createTape(s_adminOnAdminHost, tape);
}
// Create the mount criteria
catalogue.createMountPolicy(requester, "immediateMount", 1000, 0, 1000, 0, 1, "Policy comment");
catalogue.createRequesterMountRule(requester, "immediateMount", s_diskInstance, requester.username, "Rule comment");
auto mountPolicy = getImmediateMountMountPolicy();
catalogue.createMountPolicy(requester, mountPolicy);
std::string mountPolicyName = mountPolicy.name;
catalogue.createRequesterMountRule(requester, mountPolicyName, s_diskInstance, requester.username, "Rule comment");
//delete is unnecessary
//pointer with ownership will be passed to the application,
......@@ -2351,8 +2380,10 @@ TEST_P(DataTransferSessionTest, DataTransferSessionTapeFullOnFlushMigration) {
}
// Create the mount criteria
catalogue.createMountPolicy(requester, "immediateMount", 1000, 0, 1000, 0, 1, "Policy comment");
catalogue.createRequesterMountRule(requester, "immediateMount", s_diskInstance, requester.username, "Rule comment");
auto mountPolicy = getImmediateMountMountPolicy();
catalogue.createMountPolicy(requester, mountPolicy);
std::string mountPolicyName = mountPolicy.name;
catalogue.createRequesterMountRule(requester, mountPolicyName, s_diskInstance, requester.username, "Rule comment");
//delete is unnecessary
//pointer with ownership will be passed to the application,
......
......@@ -1392,10 +1392,20 @@ void RequestMessage::processMountPolicy_Add(cta::xrd::Response &response)
auto &minretrieverequestage = getRequired(OptionUInt64::MIN_RETRIEVE_REQUEST_AGE);
auto &maxdrivesallowed = getRequired(OptionUInt64::MAX_DRIVES_ALLOWED);
auto &comment = getRequired(OptionString::COMMENT);
m_catalogue.createMountPolicy(m_cliIdentity, group, archivepriority, minarchiverequestage, retrievepriority,
minretrieverequestage, maxdrivesallowed, comment);
cta::catalogue::CreateMountPolicyAttributes mountPolicy;
mountPolicy.name = group;
mountPolicy.archivePriority = archivepriority;
mountPolicy.minArchiveRequestAge = minarchiverequestage;
mountPolicy.retrievePriority = retrievepriority;
mountPolicy.minRetrieveRequestAge = minretrieverequestage;
mountPolicy.maxDrivesAllowed = maxdrivesallowed;
//TODO: Add the OptionUint64::MAX_DRIVES_ALLOWED_PER_VO
mountPolicy.maxDrivesAllowedPerVo = maxdrivesallowed;
mountPolicy.comment = comment;
m_catalogue.createMountPolicy(m_cliIdentity, mountPolicy);
response.set_type(cta::xrd::Response::RSP_SUCCESS);
}
......
Markdown is supported
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