diff --git a/xroot_plugins/XrdSsiCtaRequestMessage.cpp b/xroot_plugins/XrdSsiCtaRequestMessage.cpp index bcd14dcc0cc086ca289fff76a0a2e8873b3a5447..73a154278ef527e38f910b5f62a8df8e0450d265 100644 --- a/xroot_plugins/XrdSsiCtaRequestMessage.cpp +++ b/xroot_plugins/XrdSsiCtaRequestMessage.cpp @@ -43,7 +43,7 @@ void RequestMessage::process(const cta::xrd::Request &request, cta::xrd::Respons -void RequestMessage::processAdminCmd(const cta::xrd::AdminCmd &admin_cmd, cta::xrd::Response &response) +void RequestMessage::processAdminCmd(const cta::admin::AdminCmd &admin_cmd, cta::xrd::Response &response) { } diff --git a/xroot_plugins/XrdSsiCtaRequestMessage.hpp b/xroot_plugins/XrdSsiCtaRequestMessage.hpp index d9405bca6e57a0c30d7cab851ba821ffa6e74e67..793dddc3c5c4af44bffd44c4a218c6e392fd93f6 100644 --- a/xroot_plugins/XrdSsiCtaRequestMessage.hpp +++ b/xroot_plugins/XrdSsiCtaRequestMessage.hpp @@ -51,7 +51,7 @@ private: * @param[in] admincmd Admin command from the cta admin cli * @param[out] response Response message */ - void processAdminCmd(const cta::xrd::AdminCmd &admin_cmd, cta::xrd::Response &response); + void processAdminCmd(const cta::admin::AdminCmd &admin_cmd, cta::xrd::Response &response); /*! * Process the EOS WFE Notification message type diff --git a/xroot_plugins/messages/cta_admin.proto b/xroot_plugins/messages/cta_admin.proto new file mode 100644 index 0000000000000000000000000000000000000000..b08de27b63a8bd948efce1d6a2f95c5b86496d1e --- /dev/null +++ b/xroot_plugins/messages/cta_admin.proto @@ -0,0 +1,137 @@ +// @project The CERN Tape Archive (CTA) +// @brief CTA Admin Command API definition +// @copyright Copyright 2017 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 +// (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/>. + +syntax = "proto3"; +package cta.admin; + +// +// Command Options +// + +message OptionBoolean { + enum Key { + ALL = 0; + CHECK_CHECKSUM = 1; + DISABLED = 2; + ENCRYPTED = 3; + FORCE = 4; + FULL = 5; + JUSTEXPAND = 6; + JUSTREPACK = 7; + LBP = 8; + SHOW_HEADER = 9; + } + + Key key = 1; + bool value = 2; +} + +message OptionInteger { + enum Key { + ARCHIVE_FILE_ID = 0; + ARCHIVE_PRIORITY = 1; + RETRIEVE_PRIORITY = 2; + CAPACITY = 3; + COPY_NUMBER = 4; + FIRST_FSEQ = 5; + LAST_FSEQ = 6; + MAX_DRIVES_ALLOWED = 7; + MIN_ARCHIVE_REQUEST_AGE = 8; + MIN_RETRIEVE_REQUEST_AGE = 9; + NUMBER_OF_FILES = 10; + PARTIAL_TAPES_NUMBER = 11; + } + + Key key = 1; + int64 value = 2; +} + +message OptionString { + enum Key { + COMMENT = 0; + DISKID = 1; + DRIVE = 2; + ENCRYPTION_KEY = 3; + FILENAME = 4; + GROUP = 5; + HOSTNAME = 6; + INPUT = 7; + INSTANCE = 8; + LOGICAL_LIBRARY = 9; + MOUNT_POLICY = 10; + OUTPUT = 11; + OWNER = 12; + PATH = 13; + SIZE = 14; + STORAGE_CLASS = 15; + TAG = 16; + TAPE_POOL = 17; + USERNAME = 18; + VID = 19; + } + + Key key = 1; + string value = 2; +} + +// +// CTA Admin Command API +// + +message AdminCmd { + enum Cmd { + CMD_ADMIN = 0; + CMD_ADMINHOST = 1; + CMD_TAPEPOOL = 2; + CMD_ARCHIVEROUTE = 3; + CMD_LOGICALLIBRARY = 4; + CMD_TAPE = 5; + CMD_STORAGECLASS = 6; + CMD_REQUESTERMOUNTRULE = 7; + CMD_GROUPMOUNTRULE = 8; + CMD_MOUNTPOLICY = 9; + CMD_REPACK = 10; + CMD_SHRINK = 11; + CMD_VERIFY = 12; + CMD_ARCHIVEFILE = 13; + CMD_TEST = 14; + CMD_DRIVE = 15; + CMD_LISTPENDINGARCHIVES = 16; + CMD_LISTPENDINGRETRIEVES = 17; + CMD_SHOWQUEUES = 18; + } + enum SubCmd { + CMD_NONE = 0; + CMD_ADD = 1; + CMD_CH = 2; + CMD_ERR = 3; + CMD_LABEL = 4; + CMD_LS = 5; + CMD_RECLAIM = 6; + CMD_RM = 7; + CMD_UP = 8; + CMD_DOWN = 9; + CMD_READ = 10; + CMD_WRITE = 11; + } + + Cmd cmd = 1; //< The primary command + SubCmd subcmd = 2; //< The secondary command + repeated OptionBoolean option_bool = 3; //< List of boolean options + repeated OptionInteger option_int = 4; //< List of integer options + repeated OptionString option_str = 5; //< List of string options +} + diff --git a/xroot_plugins/messages/cta_frontend.proto b/xroot_plugins/messages/cta_frontend.proto index c812b04068179d6e51dea4637372c39ee7a27b10..25ad10765ddfbfd07f0e27d3fe3a4e8866eba3ec 100644 --- a/xroot_plugins/messages/cta_frontend.proto +++ b/xroot_plugins/messages/cta_frontend.proto @@ -17,27 +17,9 @@ syntax = "proto3"; package cta.xrd; -// CTA-EOS API - +import "cta_admin.proto"; import "cta_eos.proto"; - - -// -// CTA Admin Command API -// - -message AdminCmd { - enum CmdType { - CMD_ADMIN = 0; //< admin command - } - CmdType cmd = 1; //< Specifies the command - map<string, bool> flags = 2; //< List of flags - map<string, string> parameters = 3; //< List of parameters -} - - - // // Requests sent to the CTA Frontend // @@ -45,7 +27,7 @@ message AdminCmd { message Request { oneof request { cta.eos.Notification notification = 1; //< EOS WFE Notification - AdminCmd admincmd = 2; //< CTA Admin Command + cta.admin.AdminCmd admincmd = 2; //< CTA Admin Command } }