Module: UsageText

Defined in:
lib/usage_text.rb

Class Method Summary collapse

Class Method Details

.appengine ⇒ Object



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

.appname ⇒ Object



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

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

.auto ⇒ Object



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_info ⇒ Object



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

.confirm ⇒ Object



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

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

.email ⇒ Object



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

.file ⇒ Object



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

.force ⇒ Object



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

.group ⇒ Object



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

.h ⇒ Object



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

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

.help ⇒ Object



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

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

.iaas ⇒ Object



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

.infrastructure ⇒ Object



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_type ⇒ Object



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

.ips ⇒ Object



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

.keyname ⇒ Object



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

.machine ⇒ Object



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

.max ⇒ Object



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

.min ⇒ Object



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

.n ⇒ Object



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

.r ⇒ Object



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_tar ⇒ Object



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_info ⇒ Object



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

.scp ⇒ Object



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

.table ⇒ Object



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

.test ⇒ Object



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

.usage ⇒ Object



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

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

.v ⇒ Object



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

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

.verbose ⇒ Object



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

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

.version ⇒ Object



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

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

.w ⇒ Object



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