/* * @project The CERN Tape Archive (CTA) * @copyright Copyright © 2021-2022 CERN * @license This program is free software, distributed under the terms of the GNU General Public * Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can * redistribute it and/or modify it under the terms of the GPL Version 3, 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. * * In applying this licence, CERN does not waive the privileges and immunities * granted to it by virtue of its status as an Intergovernmental Organization or * submit itself to any jurisdiction. */ syntax = "proto3"; option java_multiple_files = true; option java_package = "ch.cern.cta.rpc"; option optimize_for = CODE_SIZE; package cta.frontend.rpc; import "google/protobuf/empty.proto"; import "cta_admin.proto"; import "cta_eos.proto"; import "cta_frontend.proto"; /* * Requests sent to the CTA Frontend */ // gRPC Request for Archive/Retrieve/Delete/Cancel events message SchedulerRequest { cta.eos.Notification md = 1; //< Metadata associated with this request string objectstore_id = 2; //< Address of the queued request in the SchedulerDB (objectstore), //< used to cancel a previous PREPARE request string client_version = 3; //< Client software version string client_protobuf_version = 4; //< Client protobuf version } // gRPC Request for Admin commands message AdminRequest { cta.admin.AdminCmd admincmd = 1; //< CTA Admin Command string client_version = 2; //< Version of cta-admin client string client_protobuf_version = 3; //< Client protobuf version } /* * Metadata responses returned by the CTA Frontend */ message CreateResponse { uint64 archive_file_id = 1; //< CTA-assigned unique file ID } message ArchiveResponse { string objectstore_id = 1; //< Address of the queued request in the SchedulerDB (objectstore), //< used to cancel the request } message RetrieveResponse { string objectstore_id = 1; //< Address of the queued request in the SchedulerDB (objectstore), //< used to cancel the request } message StreamResponse { oneof contents { cta.xrd.Response header = 1; cta.xrd.Data data = 2; } } // Negotiation message KerberosAuthenticationRequest { bytes challenge = 1; //< GSS challenge string service_principal_name = 2; //< KRB5 service principal name }; message KerberosAuthenticationResponse { bytes challenge = 1; //< GSS challenge bool is_complete = 2; bytes token = 3; //< KRB5 token string error_msg = 4; }; /* * gRPC request-response pairs */ service CtaRpc { // Generic request to give a migration path from EOS rpc GenericRequest (cta.xrd.Request) returns (cta.xrd.Response) {} // Specific request types rpc Create (SchedulerRequest) returns (CreateResponse) {} rpc Archive (SchedulerRequest) returns (ArchiveResponse) {} rpc Retrieve (SchedulerRequest) returns (RetrieveResponse) {} rpc Delete (SchedulerRequest) returns (google.protobuf.Empty) {} rpc CancelRetrieve (SchedulerRequest) returns (google.protobuf.Empty) {} // Admin commands rpc Admin (AdminRequest) returns (cta.xrd.Response) {} // Should possibly be replaced by AdminRequest "version" command rpc Version (google.protobuf.Empty) returns (cta.admin.Version) {} } service CtaRpcStream { // rpc Version (google.protobuf.Empty) returns (cta.admin.Version) {} rpc TapeLs (AdminRequest) returns (stream StreamResponse) {} } service Negotiation { rpc Negotiate (stream KerberosAuthenticationRequest) returns (stream KerberosAuthenticationResponse) {} }