@Override protected OptionSet newOptions(String[] args) { return initOptionsWithHelp(parser, help, args); }
@Override protected OptionSet newOptions(String[] args) { return initOptionsWithHelp(parser, help, args); }
@Override protected OptionSet newOptions(String[] args) { return initOptionsWithHelp(parser, help, args); }
@SuppressWarnings("PMD.PreserveStackTrace") public static OptionSet initOptionsWithHelp(OptionParser parser, String[] args) { return initOptionsWithHelp(parser, null, args); }
@Override protected OptionSet newOptions(String[] args) { return initOptionsWithHelp(parser, help, args); }
@Override protected OptionSet newOptions(String[] args) { return initOptionsWithHelp(parser, help, args); }
@Override protected OptionSet newOptions(String[] args) { workerTypeSpec.defaultsTo("member"); return initOptionsWithHelp(parser, help, args); }
WizardCli(String[] args) { options = initOptionsWithHelp(parser, args); wizard = new Wizard(); }
ProvisionerCli(String[] args) { this.options = initOptionsWithHelp(parser, args); SimulatorProperties properties = loadSimulatorProperties(); ComputeService computeService = isCloudProvider(properties) ? new ComputeServiceBuilder(properties).build() : null; Bash bash = new Bash(properties); this.tags = loadTags(options, tagsSpec); this.provisioner = new Provisioner(properties, computeService, bash); }
static AwsProvisioner init(String[] args) { AwsProvisioner.logHeader(); AwsProvisionerCli cli = new AwsProvisionerCli(); initOptionsWithHelp(cli.parser, args); SimulatorProperties properties = loadSimulatorProperties(); ComponentRegistry componentRegistry = loadComponentRegister(new File(getUserDir(), AgentsFile.NAME), false); try { String awsCredentialsPath = properties.get("AWS_CREDENTIALS", "awscredentials.properties"); File credentialsFile = new File(awsCredentialsPath); AWSCredentials credentials = new PropertiesCredentials(credentialsFile); AmazonEC2 ec2 = new AmazonEC2Client(credentials); AmazonElasticLoadBalancingClient elb = new AmazonElasticLoadBalancingClient(credentials); return new AwsProvisioner(ec2, elb, componentRegistry, properties); } catch (Exception e) { throw new CommandLineExitException("Credentials file could not be loaded", e); } }
static HeatMap init(String[] args) { HeatMap.logHeader(); HeatMapCli cli = new HeatMapCli(); OptionSet options = initOptionsWithHelp(cli.parser, args); SimulatorProperties simulatorProperties = new SimulatorProperties(); simulatorProperties.init(getPropertiesFile(cli, options)); return new HeatMap(options.valueOf(cli.directorySpec), options.valueOf(cli.testNameSpec), options.valueOf(cli.probeNameSpec)); }
HarakiriMonitorCli(String[] args) { OptionSet options = CliUtils.initOptionsWithHelp(parser, args); if (!options.has(cloudProviderSpec)) { throw new CommandLineExitException("You have to provide --cloudProvider"); } if (!options.has(cloudIdentitySpec)) { throw new CommandLineExitException("You have to provide --cloudIdentity"); } if (!options.has(cloudCredentialSpec)) { throw new CommandLineExitException("You have to provide --cloudCredential"); } harakiriMonitor = new HarakiriMonitor( options.valueOf(cloudProviderSpec), options.valueOf(cloudIdentitySpec), options.valueOf(cloudCredentialSpec), options.valueOf(timeoutSpec)); }
static void run(String[] args, AwsProvisioner provisioner) { AwsProvisionerCli cli = new AwsProvisionerCli(); OptionSet options = initOptionsWithHelp(cli.parser, args); try { if (options.has(cli.scaleSpec)) { int count = options.valueOf(cli.scaleSpec); provisioner.scaleInstanceCountTo(count); } else if (options.has(cli.createLoadBalancerSpec)) { String name = options.valueOf(cli.createLoadBalancerSpec); provisioner.createLoadBalancer(name); } else if (options.has(cli.addAgentsToLoadBalancer)) { String name = options.valueOf(cli.addAgentsToLoadBalancer); provisioner.addAgentsToLoadBalancer(name); } else { printHelpAndExit(cli.parser); } } finally { provisioner.shutdown(); } } }
CoordinatorCli(String[] args) { this.options = initOptionsWithHelp(parser, args); this.simulatorProperties = loadSimulatorProperties(); this.componentRegistry = newComponentRegistry(simulatorProperties); if (options.has(downloadSpec) || options.has(cleanSpec)) { this.downloader = new CoordinatorDownloader(componentRegistry, simulatorProperties); } else { this.coordinatorParameters = loadCoordinatorParameters(); this.coordinator = new Coordinator(componentRegistry, coordinatorParameters); this.testSuite = loadTestSuite(); if (testSuite == null) { int coordinatorPort = simulatorProperties.getCoordinatorPort(); if (coordinatorPort == 0) { throw new CommandLineExitException("Can't run without a testSuite, and not have a coordinator port enabled." + "Please add COORDINATOR_PORT=5000 to your simulator.properties or run with a testsuite."); } } else { this.workerParametersMap = loadWorkerParameters(); this.deploymentPlan = newDeploymentPlan(); this.runMonolith = new CoordinatorRunMonolith(coordinator, coordinatorParameters); } } }
AgentCli(String[] args) { logHeader(); options = CliUtils.initOptionsWithHelp(parser, args); if (!options.has(addressIndexSpec)) { throw new CommandLineExitException("Missing parameter: --addressIndex"); } int addressIndex = options.valueOf(addressIndexSpec); if (!options.has(publicAddressSpec)) { throw new CommandLineExitException("Missing parameter: --publicAddress"); } String publicAddress = options.valueOf(publicAddressSpec); if (!options.has(portSpec)) { throw new CommandLineExitException("Missing parameter: --port"); } int port = options.valueOf(portSpec); this.cloudProvider = options.valueOf(cloudProviderSpec); this.cloudIdentity = options.valueOf(cloudIdentitySpec); this.cloudCredential = options.valueOf(cloudCredentialSpec); Integer threadPoolSize = options.valueOf(threadPoolSizeSpec); Integer workerLastSeenTimeoutSeconds = options.valueOf(workerLastSeenTimeoutSecondsSpec); this.agent = new Agent( addressIndex, publicAddress, port, threadPoolSize, workerLastSeenTimeoutSeconds); }