CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmd_transaction.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_PUBLISH_CMD_TRANSACTION_H_
6 #define CVMFS_PUBLISH_CMD_TRANSACTION_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "publish/command.h"
12 
13 namespace publish {
14 
15 class CmdTransaction : public Command {
16  public:
17  virtual std::string GetName() const { return "transaction"; }
18  virtual std::string GetBrief() const {
19  return "Open a managed repository for writing";
20  }
21  virtual std::string GetDescription() const {
22  return "A transaction gets a lease for a repository in order to write "
23  "new content. The content is not visible to clients until publication. "
24  "Transactions can be aborted in order to revert to the original state. "
25  "Repositories that are configured to use a CernVM-FS gateway can lock "
26  "certain sub paths, such that other publisher nodes can publish "
27  "concurrently to other sub trees.";
28  }
29  virtual std::string GetUsage() const {
30  return "[options] <repository name>[path]";
31  }
32  virtual std::vector<std::string> DoGetExamples() const {
33  std::vector<std::string> e;
34  e.push_back("example.cvmfs.io "
35  "# normal use with a locally managed repository");
36  e.push_back("example.cvmfs.io/64bit/v42 "
37  "# locks only the given sub tree, use with gateway "
38  "(no space between the repository name and the path)");
39  e.push_back("example.cvmfs.io/popular/path -t 500 "
40  "# retries for a maximum of 5 minutes to lock /popular/path");
41  return e;
42  }
43  virtual ParameterList GetParams() const {
44  ParameterList p;
45  p.push_back(Parameter::Optional("retry-timeout", 't', "seconds",
46  "Retry for a maximum number of given seconds if repository is busy "
47  "(0 for infinite)"));
48  p.push_back(Parameter::Optional("template", 'T', "from-dir=to-dir",
49  "Clone directory 'from-dir' to 'to-dir' as part of opening the "
50  "transaction"));
51  p.push_back(Parameter::Optional("template-from", 'U', "from-dir",
52  "Use -U and -V as an alternative to the -T parameter"));
53  p.push_back(Parameter::Optional("template-to", 'V', "to-dir",
54  "Use -U and -V as an alternative to the -T parameter"));
55  return p;
56  }
57 
58  virtual int Main(const Options &options);
59 }; // class CmdTransaction
60 
61 } // namespace publish
62 
63 #endif // CVMFS_PUBLISH_CMD_TRANSACTION_H_
static Parameter Optional(const std::string &key, char short_key, const std::string &arg_name, const std::string &desc)
Definition: command.h:73
virtual ParameterList GetParams() const
virtual std::string GetBrief() const
virtual int Main(const Options &options)
virtual std::string GetName() const
std::vector< Parameter > ParameterList
Definition: command.h:92
virtual std::string GetDescription() const
virtual std::vector< std::string > DoGetExamples() const
virtual std::string GetUsage() const