XRootD
XrdClHttpTape.hh
Go to the documentation of this file.
1 /******************************************************************************/
2 /* */
3 /* X r d C l H t t p T a p e . h h */
4 /* */
5 /* (c) 2026 by the XRootD Collaboration */
6 /* */
7 /* This file is part of the XRootD software suite. */
8 /* */
9 /* XRootD is free software: you can redistribute it and/or modify it under */
10 /* the terms of the GNU Lesser General Public License as published by the */
11 /* Free Software Foundation, either version 3 of the License, or (at your */
12 /* option) any later version. */
13 /* */
14 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
15 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
16 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
17 /* License for more details. */
18 /* */
19 /* You should have received a copy of the GNU Lesser General Public License */
20 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
21 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
22 /* */
23 /******************************************************************************/
24 
25 #ifndef XRDCLHTTP_TAPE_HH
26 #define XRDCLHTTP_TAPE_HH
27 
28 #include "XrdClHttpVerb.hh"
29 
30 #include "XrdCl/XrdClFileSystem.hh"
32 
33 #include <string>
34 #include <memory>
35 #include <vector>
36 
37 #include <curl/curl.h>
38 
39 namespace XrdClHttp
40 {
42  {
43  HttpVerb method = HttpVerb::GET;
44  std::string url;
45  std::string body;
46  };
47 
48  // Translates one XrdCl Prepare or Query operation into the two HTTP
49  // requests used by Tape REST: endpoint discovery followed by the operation.
50  // Transport remains owned by CurlTapeOp and the XrdClHttp worker pool.
52  {
53  public:
54  TapeOperation( const std::string &url,
55  const std::vector<std::string> &fileList,
57  TapeOperation( const std::string &url,
58  XrdCl::QueryCode::Code queryCode,
59  const XrdCl::Buffer &arg );
61 
62  TapeOperation( const TapeOperation & ) = delete;
63  TapeOperation &operator=( const TapeOperation & ) = delete;
64 
66 
68  long statusCode,
69  const std::string &body,
70  TapeHttpRequest &request,
71  std::string &response,
72  bool &complete );
73 
74  private:
75  struct Impl;
76  std::unique_ptr<Impl> pImpl;
77  };
78 
79  std::string TapeProblemResponse( long statusCode,
80  const std::string &body );
81 }
82 
83 #endif // XRDCLHTTP_TAPE_HH
void CURL
XrdCl::XRootDStatus Advance(CURL *curl, long statusCode, const std::string &body, TapeHttpRequest &request, std::string &response, bool &complete)
TapeOperation & operator=(const TapeOperation &)=delete
TapeOperation(const std::string &url, const std::vector< std::string > &fileList, XrdCl::PrepareFlags::Flags flags)
TapeOperation(const TapeOperation &)=delete
XrdCl::XRootDStatus Start(TapeHttpRequest &request)
Binary blob representation.
Definition: XrdClBuffer.hh:34
std::string TapeProblemResponse(long statusCode, const std::string &body)
Code
XRootD query request codes.