Module: UsageText

Defined in:
lib/usage_text.rb

Class Method Summary collapse

Class Method Details

.appengineObject



20
21
22
# File 'lib/usage_text.rb', line 20

def self.appengine
  "--appengine NUM: The number of application servers that should be spawned up for each Google App Engine app."
end

.appnameObject



24
25
26
# File 'lib/usage_text.rb', line 24

def self.appname
  "--appname APPNAME: The name of the application to remove."
end

.autoObject



28
29
30
# File 'lib/usage_text.rb', line 28

def self.auto
  "--auto: Requests the SSH login password from the user once, and then automatically reuses the password on each machine."
end

.backup_neptune_infoObject



32
33
34
# File 'lib/usage_text.rb', line 32

def self.backup_neptune_info
  "--backup_neptune_info FILE: Backs up Neptune job metadata to FILE."
end

.confirmObject



36
37
38
# File 'lib/usage_text.rb', line 36

def self.confirm
  "--confirm: Skips the confirmation step when removing an application."
end

.emailObject



40
41
42
# File 'lib/usage_text.rb', line 40

def self.email
  "--email EMAIL: Uses EMAIL as the app administrator for the given application instead of prompting for it."
end

.fileObject



44
45
46
# File 'lib/usage_text.rb', line 44

def self.file
  "--file FILE: The app to upload. Must be a directory or file tar'ed up via 'tar -czf app.tar.gz .' in the application's top level directory."
end

.forceObject



48
49
50
# File 'lib/usage_text.rb', line 48

def self.force
  "--force: If the given keyname is already in use, remove it from the system and add a new key with the same name."
end

.get_usage(file_name, flags) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/usage_text.rb', line 7

def self.get_usage(file_name, flags)
  preamble = "#{AS_VERSION}\n\nUsage: #{file_name} OPTIONS\n\nFlags:"
  flag_text = ""
  flags.each { |flag|
    if !self.respond_to?(flag.to_sym)
      raise BadCommandLineArgException.new(flag)
    end

    flag_text += "\n\t" + self.send(flag.to_sym)
  }
  return preamble + flag_text + "\n\n"
end

.groupObject



52
53
54
# File 'lib/usage_text.rb', line 52

def self.group
  "--group: The name of the security group to create when running over a cloud infrastructure."
end

.hObject



56
57
58
# File 'lib/usage_text.rb', line 56

def self.h
  "-h: Displays this usage message."
end

.helpObject



60
61
62
# File 'lib/usage_text.rb', line 60

def self.help
  "--help: Displays this usage message."
end

.iaasObject



68
69
70
# File 'lib/usage_text.rb', line 68

def self.iaas
  "--iaas INFRASTRUCTURE: Same as --infrastructure, but if no value is provided, defaults to euca."
end

.infrastructureObject



72
73
74
# File 'lib/usage_text.rb', line 72

def self.infrastructure
  "--infrastructure INFRASTRUCTURE: The cloud infrastructure that AppScale should utilize. Acceptable values are: #{VALID_CLOUD_TYPES.join(', ')}."
end

.instance_typeObject



64
65
66
# File 'lib/usage_text.rb', line 64

def self.instance_type
  "--instance_type: The instance type to use if using Eucalyptus. Defaults to m1.large if not provided. Supported values are m1.large, m1.xlarge, and c1.xlarge."
end

.ipsObject



76
77
78
# File 'lib/usage_text.rb', line 76

def self.ips
  "--ips: The YAML file containing the IPs (and optionally, the service placement) of the machines to use."
end

.keynameObject



80
81
82
# File 'lib/usage_text.rb', line 80

def self.keyname
  "--keyname KEYNAME: The name of the SSH key to use for Eucalyptus. Two AppScale instances can be run concurrently in one cloud if they have unique names, and they can conflict if they have the same name."
end

.machineObject



84
85
86
# File 'lib/usage_text.rb', line 84

def self.machine
  "--machine IMAGE_ID: The machine image to use in Amazon EC2 or Eucalyptus. Supercedes the contents of the environment variable APPSCALE_MACHINE, which is otherwise used if this flag is not present."
end

.maxObject



92
93
94
# File 'lib/usage_text.rb', line 92

def self.max
  "--max NUM: The maximum number of VMs to spawn for AppScale in cloud deployments."
end

.minObject



88
89
90
# File 'lib/usage_text.rb', line 88

def self.min
  "--min NUM: The minimum number of VMs to spawn for AppScale in cloud deployments."
end

.nObject



96
97
98
# File 'lib/usage_text.rb', line 96

def self.n
  "-n NUM: The replication factor that should be used with the underlying database."
end

.rObject



100
101
102
# File 'lib/usage_text.rb', line 100

def self.r
  "-r NUM: The number of database nodes needed for a read to succeed. Not supported by all databases."
end

.restore_from_tarObject



104
105
106
# File 'lib/usage_text.rb', line 104

def self.restore_from_tar
  "--restore_from_tar LOCATION: The location of the tar file that can be used to back up the state of a previously running AppScale deployment."
end

.restore_neptune_infoObject



108
109
110
# File 'lib/usage_text.rb', line 108

def self.restore_neptune_info
  "--restore_neptune_info LOCATION: The location of a previously saved Neptune job metadata file, to be used when starting a new Appscale deployment."
end

.scpObject



112
113
114
# File 'lib/usage_text.rb', line 112

def self.scp
  "--scp LOCATION: A location on the local file system where a copy of the AppScale main branch is located. This flag instructs the tools to rsync this branch over to all nodes used. Useful for testing and debugging. If no value is provided, ~/appscale is used."
end

.tableObject



116
117
118
# File 'lib/usage_text.rb', line 116

def self.table
  "--table DATABASE: The database to use with AppScale. Acceptable values are: #{VALID_TABLE_TYPES.join(', ')} (default is #{DEFAULT_DATASTORE})."
end

.testObject



120
121
122
# File 'lib/usage_text.rb', line 120

def self.test
  "--test: Uses a default username and password when uploading an application. Intended for testing only."
end

.usageObject



124
125
126
# File 'lib/usage_text.rb', line 124

def self.usage
  "--usage: Displays this usage message."
end

.vObject



128
129
130
# File 'lib/usage_text.rb', line 128

def self.v
  "-v: Displays extra output. Useful for debugging."
end

.verboseObject



132
133
134
# File 'lib/usage_text.rb', line 132

def self.verbose
  "--verbose: Displays extra output. Useful for debugging."
end

.versionObject



136
137
138
# File 'lib/usage_text.rb', line 136

def self.version
  "--version: Displays the version of the AppScale tools used."
end

.wObject



140
141
142
# File 'lib/usage_text.rb', line 140

def self.w
  "-w NUM: The number of database nodes needed for a write to succeed. Not supported by all databases."
end