List of usage examples for org.apache.commons.cli OptionBuilder isRequired
public static OptionBuilder isRequired()
From source file:org.apache.ambari.client.ClusterCreate.java
public void addOptions() { Option wait = new Option("wait", "Optionally wait for cluster to reach desired state"); Option dry_run = new Option("dry_run", "Dry run"); Option help = new Option("help", "Help"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();/* www . j a v a 2 s .c o m*/ OptionBuilder.withDescription("Name of the cluster to be created"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("stack_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the cluster stack"); Option stack = OptionBuilder.create("stack"); OptionBuilder.withArgName("\"node_exp1; node_exp2; ...\""); OptionBuilder.isRequired(); OptionBuilder.hasArg(); OptionBuilder.withDescription( "List of node range expressions separated by semicolon (;) and contained in double quotes (\"\")"); Option nodes = OptionBuilder.create("nodes"); OptionBuilder.withArgName("stack_revision"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Stack revision, if not specified latest revision is used"); Option revision = OptionBuilder.create("revision"); OptionBuilder.withArgName("description"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Description to be associated with cluster"); Option desc = OptionBuilder.create("desc"); OptionBuilder.withArgName("goalstate"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Desired goal state of the cluster"); Option goalstate = OptionBuilder.create("goalstate"); OptionBuilder.withArgName("\"component-1; component-2; ...\""); OptionBuilder.hasArg(); OptionBuilder.withDescription( "List of components to be active in the cluster. Components are seperated by semicolon \";\""); Option services = OptionBuilder.create("services"); OptionBuilder.withArgName("rolename=\"node_exp1; node_exp2; ... \""); OptionBuilder.hasArgs(2); OptionBuilder.withValueSeparator(); OptionBuilder.withDescription( "Provide node range expressions for a given rolename separated by semicolon (;) and contained in double quotes (\"\")"); Option role = OptionBuilder.create("role"); this.options = new Options(); options.addOption(wait); options.addOption(dry_run); options.addOption(name); options.addOption(stack); options.addOption(revision); options.addOption(desc); options.addOption(role); options.addOption(goalstate); options.addOption(nodes); options.addOption(services); options.addOption(help); }
From source file:org.apache.ambari.client.ClusterDelete.java
public void addOptions() { Option wait = new Option("wait", "Optionally wait for cluster to reach desired state"); Option help = new Option("help", "Help"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();/* www.j a v a2s .com*/ OptionBuilder.withDescription("Name of the cluster to be deleted"); Option name = OptionBuilder.create("name"); this.options = new Options(); options.addOption(wait); options.addOption(name); options.addOption(help); }
From source file:org.apache.ambari.client.ClusterGet.java
public void addOptions() { Option help = new Option("help", "Help"); Option verbose = new Option("verbose", "Verbose mode"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();/* w w w.jav a 2s.c o m*/ OptionBuilder.withDescription("Name of the cluster"); Option name = OptionBuilder.create("name"); this.options = new Options(); options.addOption(name); options.addOption(verbose); options.addOption(help); }
From source file:org.apache.ambari.client.ClusterNodes.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();//from ww w . j av a 2 s .co m OptionBuilder.withDescription("Name of the cluster to be created"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("role_name"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Role name to get list of nodes associated with specified role"); Option role = OptionBuilder.create("role"); OptionBuilder.withArgName("[true/false]"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Node state alive as true or false"); Option alive = OptionBuilder.create("alive"); this.options = new Options(); options.addOption(name); options.addOption(role); options.addOption(alive); options.addOption(help); }
From source file:org.apache.ambari.client.ClusterRename.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();/* w w w.j a v a2s .c o m*/ OptionBuilder.withDescription("Name of the cluster to be renamed"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("new_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg(); OptionBuilder.withDescription("New name of the cluster"); Option new_name = OptionBuilder.create("new_name"); this.options = new Options(); options.addOption(new_name); options.addOption(name); options.addOption(help); }
From source file:org.apache.ambari.client.ClusterStack.java
public void addOptions() { Option help = new Option("help", "Help"); Option expanded = new Option("expanded", "Return expanded version of stack inlining parent stack"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();//w w w. j av a2s . c om OptionBuilder.withDescription("Name of the cluster"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("file_path"); OptionBuilder.hasArg(); OptionBuilder.withDescription("File path to store the stack locally on client side"); Option file = OptionBuilder.create("file"); this.options = new Options(); options.addOption(name); options.addOption(file); options.addOption(expanded); options.addOption(help); }
From source file:org.apache.ambari.client.ClusterUpdate.java
public void addOptions() { Option wait = new Option("wait", "Optionally wait for cluster to reach desired state"); Option dry_run = new Option("dry_run", "Dry run"); Option help = new Option("help", "Help"); OptionBuilder.withArgName("cluster_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();// ww w . j a va 2s. c o m OptionBuilder.withDescription("Name of the cluster to be updated"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("stack_name"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the cluster stack"); Option stack = OptionBuilder.create("stack"); OptionBuilder.withArgName("\"node_exp1; node_exp2; ...\""); OptionBuilder.hasArg(); OptionBuilder.withDescription( "List of node range expressions separated by semicolon (;) and contained in double quotes (\"\")"); Option nodes = OptionBuilder.create("nodes"); OptionBuilder.withArgName("stack_revision"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Stack revision"); Option revision = OptionBuilder.create("revision"); OptionBuilder.withArgName("description"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Description associated with cluster"); Option desc = OptionBuilder.create("desc"); OptionBuilder.withArgName("goalstate"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Desired goal state of the cluster"); Option goalstate = OptionBuilder.create("goalstate"); OptionBuilder.withArgName("\"component-1; component-2; ...\""); OptionBuilder.hasArg(); OptionBuilder.withDescription( "List of components to be active in the cluster. Components are seperated by semicolon \";\""); Option services = OptionBuilder.create("services"); OptionBuilder.withArgName("rolename=\"node_exp1; node_exp2; ... \""); OptionBuilder.hasArgs(2); OptionBuilder.withValueSeparator(); OptionBuilder.withDescription( "Node range expressions for a given rolename separated by semicolon (;) and contained in double quotes (\"\")"); Option role = OptionBuilder.create("role"); this.options = new Options(); options.addOption(wait); options.addOption(dry_run); options.addOption(name); options.addOption(stack); options.addOption(revision); options.addOption(desc); options.addOption(role); options.addOption(goalstate); options.addOption(nodes); options.addOption(services); options.addOption(help); }
From source file:org.apache.ambari.client.NodeGet.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("node_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();/* w w w . j a v a 2 s.co m*/ OptionBuilder.withDescription("Name of the node"); Option name = OptionBuilder.create("name"); this.options = new Options(); options.addOption(name); options.addOption(help); }
From source file:org.apache.ambari.client.StackAdd.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();/*from w w w. j a va2s. co m*/ OptionBuilder.withDescription("Name of the stack"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("location"); OptionBuilder.isRequired(); OptionBuilder.hasArg(); OptionBuilder.withDescription("Either URL or local file path where stack in JSON format is available"); Option location = OptionBuilder.create("location"); this.options = new Options(); options.addOption(location); options.addOption(name); options.addOption(help); }
From source file:org.apache.ambari.client.StackGet.java
public void addOptions() { Option help = new Option("help", "Help"); OptionBuilder.withArgName("stack_name"); OptionBuilder.isRequired(); OptionBuilder.hasArg();// www . j av a 2s .co m OptionBuilder.withDescription("Name of the stack"); Option name = OptionBuilder.create("name"); OptionBuilder.withArgName("revision"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Name of the cluster"); Option revision = OptionBuilder.create("revision"); OptionBuilder.withArgName("file_path"); OptionBuilder.hasArg(); OptionBuilder.withDescription("Local file path"); Option file = OptionBuilder.create("file"); this.options = new Options(); options.addOption(name); options.addOption(revision); options.addOption(file); options.addOption(help); }