vmcu 0.3.19 → 0.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +160 -160
- data/lib/cli/commands/admin.rb +80 -80
- data/lib/cli/config.rb +6 -0
- data/lib/cli/usage.rb +118 -118
- data/lib/cli/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,160 +1,160 @@
|
|
1
|
-
# VMCU
|
2
|
-
|
3
|
-
The VMware Cloud CLI. This is the command line interface to VMware's Application Platform
|
4
|
-
|
5
|
-
_Copyright 2010-2011, VMware, Inc. Licensed under the
|
6
|
-
MIT license, please see the LICENSE file. All rights reserved._
|
7
|
-
_Copyright (c) 2011 Uhuru Software, Inc., All Rights Reserved_
|
8
|
-
|
9
|
-
Usage: vmcu [options] command [<args>] [command_options]
|
10
|
-
Try 'vmcu help [command]' or 'vmcu help options' for more information.
|
11
|
-
|
12
|
-
Currently available vmcu commands are:
|
13
|
-
|
14
|
-
Getting Started
|
15
|
-
target [url] Reports current target or sets a new target
|
16
|
-
login [email] [--email, --passwd] Login
|
17
|
-
login [token] [--token UHURU_TOKEN] Login for Uhuru AppCloud
|
18
|
-
cloud-team [name or id] [--realm REALM] Set cloud team for UhuruApp Cloud. Sys admins can proxy realms.
|
19
|
-
import-uhuru Import targets from Uhuru Cloud Foundry Manager
|
20
|
-
info System and account information
|
21
|
-
|
22
|
-
Applications
|
23
|
-
apps List deployed applications
|
24
|
-
|
25
|
-
Application Creation
|
26
|
-
push [appname] Create, push, map, and start a new application
|
27
|
-
push [appname] --path Push application from specified path
|
28
|
-
push [appname] --url Set the url for the application
|
29
|
-
push [appname] --instances <N> Set the expected number <N> of instances
|
30
|
-
push [appname] --mem M Set the memory reservation for the application
|
31
|
-
push [appname] --no-start Do not auto-start the application
|
32
|
-
|
33
|
-
Application Operations
|
34
|
-
start <appname> Start the application
|
35
|
-
stop <appname> Stop the application
|
36
|
-
restart <appname> Restart the application
|
37
|
-
delete <appname> Delete the application
|
38
|
-
|
39
|
-
Application Updates
|
40
|
-
update <appname> [--path] Update the application bits
|
41
|
-
mem <appname> [memsize] Update the memory reservation for an application
|
42
|
-
map <appname> <url> Register the application to the url
|
43
|
-
unmap <appname> <url> Unregister the application from the url
|
44
|
-
instances <appname> <num|delta> Scale the application instances up or down
|
45
|
-
|
46
|
-
Application Information
|
47
|
-
crashes <appname> List recent application crashes
|
48
|
-
crashlogs <appname> Display log information for crashed applications
|
49
|
-
logs <appname> [--all] Display log information for the application
|
50
|
-
files <appname> [path] [--all] Display directory listing or file download for path
|
51
|
-
stats <appname> Display resource usage for the application
|
52
|
-
instances <appname> List application instances
|
53
|
-
|
54
|
-
Application Environment
|
55
|
-
env <appname> List application environment variables
|
56
|
-
env-add <appname> <variable[=]value> Add an environment variable to an application
|
57
|
-
env-del <appname> <variable> Delete an environment variable to an application
|
58
|
-
|
59
|
-
Services
|
60
|
-
services Lists of services available and provisioned
|
61
|
-
create-service <service> [--name,--bind] Create a provisioned service
|
62
|
-
create-service <service> <name> Create a provisioned service and assign it <name>
|
63
|
-
create-service <service> <name> <app> Create a provisioned service and assign it <name>, and bind to <app>
|
64
|
-
delete-service [servicename] Delete a provisioned service
|
65
|
-
bind-service <servicename> <appname> Bind a service to an application
|
66
|
-
unbind-service <servicename> <appname> Unbind service from the application
|
67
|
-
clone-services <src-app> <dest-app> Clone service bindings from <src-app> application to <dest-app>
|
68
|
-
tunnel <servicename> [--port] Create a local tunnel to a service
|
69
|
-
tunnel <servicename> <clientcmd> Create a local tunnel to a service and start a local client
|
70
|
-
|
71
|
-
Administration
|
72
|
-
user Display user account information
|
73
|
-
passwd Change the password for the current user
|
74
|
-
logout Logs current user out of the target system
|
75
|
-
add-user [--email, --passwd] Register a new user (requires admin privileges)
|
76
|
-
delete-user <user> Delete a user and all apps and services (requires admin privileges)
|
77
|
-
|
78
|
-
System
|
79
|
-
runtimes Display the supported runtimes of the target system
|
80
|
-
frameworks Display the recognized frameworks of the target system
|
81
|
-
|
82
|
-
Micro Cloud Foundry
|
83
|
-
micro status Display Micro Cloud Foundry VM status
|
84
|
-
mciro offline Configure Micro Cloud Foundry VM for offline mode
|
85
|
-
micro online Configure Micro Cloud Foundry VM for online mode
|
86
|
-
[--vmx file] Path to micro.vmx
|
87
|
-
[--vmrun executable] Path to vmrun executable
|
88
|
-
[--password cleartext] Cleartext password for guest VM vcap user
|
89
|
-
[--save] Save cleartext password in ~/.vmc_micro
|
90
|
-
|
91
|
-
Misc
|
92
|
-
aliases List aliases
|
93
|
-
alias <alias[=]command> Create an alias for a command
|
94
|
-
unalias <alias> Remove an alias
|
95
|
-
targets List known targets and associated authorization tokens
|
96
|
-
|
97
|
-
Help
|
98
|
-
help [command] Get general help or help on a specific command
|
99
|
-
help options Get help on available options
|
100
|
-
|
101
|
-
## Simple Story (for Ruby apps)
|
102
|
-
|
103
|
-
vmcu target api.cloudfoundry.com
|
104
|
-
vmcu login
|
105
|
-
bundle package
|
106
|
-
vmcu push
|
107
|
-
|
108
|
-
## Uhuru example
|
109
|
-
|
110
|
-
# To build the gem and install it from source:
|
111
|
-
> git clone git://github.com/UhuruSoftware/vmcu.git # Or just download the source from GitHub
|
112
|
-
> cd vmcu
|
113
|
-
> gem build vmcu.gemspec
|
114
|
-
> gem install vmcu-*.*.*.gem # Replace * with current version
|
115
|
-
|
116
|
-
# target to Uhuru AppCloud with the usual target command. It will automatically detect if it is a Uhuru AppCloud
|
117
|
-
# syntax: vmcu target
|
118
|
-
> vmcu target-uhuru 192.168.1.10
|
119
|
-
|
120
|
-
# Log to Uhuru AppCloud with the login command. Both a normal Uhuru AppCloud authentication token or a One Time Token
|
121
|
-
# are valid options
|
122
|
-
# syntax: login [token] [--token UHURU_TOKEN]
|
123
|
-
> vmcu login rabbit-bear
|
124
|
-
|
125
|
-
# Target to a cloud team. If the cloud team is not beforehand, available cloud teams are presented.
|
126
|
-
# syntax: cloud-team [name or id] [--realm REALM] Set cloud team for Uhuru App Cloud. Sys admins can proxy realms.
|
127
|
-
> vmcu cloud-team
|
128
|
-
1: G0003 [Id: 09d8b20e-daf5-489f-8502-e4c886bc9ec6]
|
129
|
-
Which cloud team would you like to target to?:
|
130
|
-
> 1
|
131
|
-
Targeted to Uhuru AppCloud: [http://services.uhurucloud.com]
|
132
|
-
Cloud Team: [09d8b20e-daf5-489f-8502-e4c886bc9ec6]
|
133
|
-
Cloud Foundry domain: [uhurucloud.com]
|
134
|
-
|
135
|
-
# do some work
|
136
|
-
> vmcu apps
|
137
|
-
|
138
|
-
# target to a regular Cloud Foundry target
|
139
|
-
> vmcu target api.uhurucloud.net
|
140
|
-
> vmcu login
|
141
|
-
|
142
|
-
# do some work
|
143
|
-
> vmcu apps
|
144
|
-
|
145
|
-
# target back to the saved Uhuru AppCloud
|
146
|
-
> vmcu target 192.168.1.10
|
147
|
-
> vmcu apps
|
148
|
-
|
149
|
-
# import target from Uhuru Cloud Foundry Manager
|
150
|
-
> vmcu import-uhuru
|
151
|
-
1: Cloud Foundry [http://api.sstest.cloudfoundry.me] / stefan.schneider@uhurusoftware.com
|
152
|
-
2: Cloud Foundry [http://api.uhurucloud.net] / dev@uhurucloud.org
|
153
|
-
3: Uhuru AppCloud [http://www.uhurusts.com/] / BillingAccount5cb1a91539a5472787d289e9bd9493f6 / test / test
|
154
|
-
4: Uhuru AppCloud [http://192.168.1.10/] / BillingAccount5cb1a91539a5472787d289e9bd9493f6 / test / test
|
155
|
-
Which target to import?:
|
156
|
-
> 2
|
157
|
-
Targeted to Cloud Foundry [http://api.uhurucloud.net] / dev@uhurucloud.org
|
158
|
-
|
159
|
-
# do some work
|
160
|
-
> vmcu apps
|
1
|
+
# VMCU
|
2
|
+
|
3
|
+
The VMware Cloud CLI. This is the command line interface to VMware's Application Platform
|
4
|
+
|
5
|
+
_Copyright 2010-2011, VMware, Inc. Licensed under the
|
6
|
+
MIT license, please see the LICENSE file. All rights reserved._
|
7
|
+
_Copyright (c) 2011 Uhuru Software, Inc., All Rights Reserved_
|
8
|
+
|
9
|
+
Usage: vmcu [options] command [<args>] [command_options]
|
10
|
+
Try 'vmcu help [command]' or 'vmcu help options' for more information.
|
11
|
+
|
12
|
+
Currently available vmcu commands are:
|
13
|
+
|
14
|
+
Getting Started
|
15
|
+
target [url] Reports current target or sets a new target
|
16
|
+
login [email] [--email, --passwd] Login
|
17
|
+
login [token] [--token UHURU_TOKEN] Login for Uhuru AppCloud
|
18
|
+
cloud-team [name or id] [--realm REALM] Set cloud team for UhuruApp Cloud. Sys admins can proxy realms.
|
19
|
+
import-uhuru Import targets from Uhuru Cloud Foundry Manager
|
20
|
+
info System and account information
|
21
|
+
|
22
|
+
Applications
|
23
|
+
apps List deployed applications
|
24
|
+
|
25
|
+
Application Creation
|
26
|
+
push [appname] Create, push, map, and start a new application
|
27
|
+
push [appname] --path Push application from specified path
|
28
|
+
push [appname] --url Set the url for the application
|
29
|
+
push [appname] --instances <N> Set the expected number <N> of instances
|
30
|
+
push [appname] --mem M Set the memory reservation for the application
|
31
|
+
push [appname] --no-start Do not auto-start the application
|
32
|
+
|
33
|
+
Application Operations
|
34
|
+
start <appname> Start the application
|
35
|
+
stop <appname> Stop the application
|
36
|
+
restart <appname> Restart the application
|
37
|
+
delete <appname> Delete the application
|
38
|
+
|
39
|
+
Application Updates
|
40
|
+
update <appname> [--path] Update the application bits
|
41
|
+
mem <appname> [memsize] Update the memory reservation for an application
|
42
|
+
map <appname> <url> Register the application to the url
|
43
|
+
unmap <appname> <url> Unregister the application from the url
|
44
|
+
instances <appname> <num|delta> Scale the application instances up or down
|
45
|
+
|
46
|
+
Application Information
|
47
|
+
crashes <appname> List recent application crashes
|
48
|
+
crashlogs <appname> Display log information for crashed applications
|
49
|
+
logs <appname> [--all] Display log information for the application
|
50
|
+
files <appname> [path] [--all] Display directory listing or file download for path
|
51
|
+
stats <appname> Display resource usage for the application
|
52
|
+
instances <appname> List application instances
|
53
|
+
|
54
|
+
Application Environment
|
55
|
+
env <appname> List application environment variables
|
56
|
+
env-add <appname> <variable[=]value> Add an environment variable to an application
|
57
|
+
env-del <appname> <variable> Delete an environment variable to an application
|
58
|
+
|
59
|
+
Services
|
60
|
+
services Lists of services available and provisioned
|
61
|
+
create-service <service> [--name,--bind] Create a provisioned service
|
62
|
+
create-service <service> <name> Create a provisioned service and assign it <name>
|
63
|
+
create-service <service> <name> <app> Create a provisioned service and assign it <name>, and bind to <app>
|
64
|
+
delete-service [servicename] Delete a provisioned service
|
65
|
+
bind-service <servicename> <appname> Bind a service to an application
|
66
|
+
unbind-service <servicename> <appname> Unbind service from the application
|
67
|
+
clone-services <src-app> <dest-app> Clone service bindings from <src-app> application to <dest-app>
|
68
|
+
tunnel <servicename> [--port] Create a local tunnel to a service
|
69
|
+
tunnel <servicename> <clientcmd> Create a local tunnel to a service and start a local client
|
70
|
+
|
71
|
+
Administration
|
72
|
+
user Display user account information
|
73
|
+
passwd Change the password for the current user
|
74
|
+
logout Logs current user out of the target system
|
75
|
+
add-user [--email, --passwd] Register a new user (requires admin privileges)
|
76
|
+
delete-user <user> Delete a user and all apps and services (requires admin privileges)
|
77
|
+
|
78
|
+
System
|
79
|
+
runtimes Display the supported runtimes of the target system
|
80
|
+
frameworks Display the recognized frameworks of the target system
|
81
|
+
|
82
|
+
Micro Cloud Foundry
|
83
|
+
micro status Display Micro Cloud Foundry VM status
|
84
|
+
mciro offline Configure Micro Cloud Foundry VM for offline mode
|
85
|
+
micro online Configure Micro Cloud Foundry VM for online mode
|
86
|
+
[--vmx file] Path to micro.vmx
|
87
|
+
[--vmrun executable] Path to vmrun executable
|
88
|
+
[--password cleartext] Cleartext password for guest VM vcap user
|
89
|
+
[--save] Save cleartext password in ~/.vmc_micro
|
90
|
+
|
91
|
+
Misc
|
92
|
+
aliases List aliases
|
93
|
+
alias <alias[=]command> Create an alias for a command
|
94
|
+
unalias <alias> Remove an alias
|
95
|
+
targets List known targets and associated authorization tokens
|
96
|
+
|
97
|
+
Help
|
98
|
+
help [command] Get general help or help on a specific command
|
99
|
+
help options Get help on available options
|
100
|
+
|
101
|
+
## Simple Story (for Ruby apps)
|
102
|
+
|
103
|
+
vmcu target api.cloudfoundry.com
|
104
|
+
vmcu login
|
105
|
+
bundle package
|
106
|
+
vmcu push
|
107
|
+
|
108
|
+
## Uhuru example
|
109
|
+
|
110
|
+
# To build the gem and install it from source:
|
111
|
+
> git clone git://github.com/UhuruSoftware/vmcu.git # Or just download the source from GitHub
|
112
|
+
> cd vmcu
|
113
|
+
> gem build vmcu.gemspec
|
114
|
+
> gem install vmcu-*.*.*.gem # Replace * with current version
|
115
|
+
|
116
|
+
# target to Uhuru AppCloud with the usual target command. It will automatically detect if it is a Uhuru AppCloud
|
117
|
+
# syntax: vmcu target
|
118
|
+
> vmcu target-uhuru 192.168.1.10
|
119
|
+
|
120
|
+
# Log to Uhuru AppCloud with the login command. Both a normal Uhuru AppCloud authentication token or a One Time Token
|
121
|
+
# are valid options
|
122
|
+
# syntax: login [token] [--token UHURU_TOKEN]
|
123
|
+
> vmcu login rabbit-bear
|
124
|
+
|
125
|
+
# Target to a cloud team. If the cloud team is not beforehand, available cloud teams are presented.
|
126
|
+
# syntax: cloud-team [name or id] [--realm REALM] Set cloud team for Uhuru App Cloud. Sys admins can proxy realms.
|
127
|
+
> vmcu cloud-team
|
128
|
+
1: G0003 [Id: 09d8b20e-daf5-489f-8502-e4c886bc9ec6]
|
129
|
+
Which cloud team would you like to target to?:
|
130
|
+
> 1
|
131
|
+
Targeted to Uhuru AppCloud: [http://services.uhurucloud.com]
|
132
|
+
Cloud Team: [09d8b20e-daf5-489f-8502-e4c886bc9ec6]
|
133
|
+
Cloud Foundry domain: [uhurucloud.com]
|
134
|
+
|
135
|
+
# do some work
|
136
|
+
> vmcu apps
|
137
|
+
|
138
|
+
# target to a regular Cloud Foundry target
|
139
|
+
> vmcu target api.uhurucloud.net
|
140
|
+
> vmcu login
|
141
|
+
|
142
|
+
# do some work
|
143
|
+
> vmcu apps
|
144
|
+
|
145
|
+
# target back to the saved Uhuru AppCloud
|
146
|
+
> vmcu target 192.168.1.10
|
147
|
+
> vmcu apps
|
148
|
+
|
149
|
+
# import target from Uhuru Cloud Foundry Manager
|
150
|
+
> vmcu import-uhuru
|
151
|
+
1: Cloud Foundry [http://api.sstest.cloudfoundry.me] / stefan.schneider@uhurusoftware.com
|
152
|
+
2: Cloud Foundry [http://api.uhurucloud.net] / dev@uhurucloud.org
|
153
|
+
3: Uhuru AppCloud [http://www.uhurusts.com/] / BillingAccount5cb1a91539a5472787d289e9bd9493f6 / test / test
|
154
|
+
4: Uhuru AppCloud [http://192.168.1.10/] / BillingAccount5cb1a91539a5472787d289e9bd9493f6 / test / test
|
155
|
+
Which target to import?:
|
156
|
+
> 2
|
157
|
+
Targeted to Cloud Foundry [http://api.uhurucloud.net] / dev@uhurucloud.org
|
158
|
+
|
159
|
+
# do some work
|
160
|
+
> vmcu apps
|
data/lib/cli/commands/admin.rb
CHANGED
@@ -1,80 +1,80 @@
|
|
1
|
-
module VMC::Cli::Command
|
2
|
-
|
3
|
-
class Admin < Base
|
4
|
-
|
5
|
-
def list_users
|
6
|
-
users = client.users
|
7
|
-
users.sort! {|a, b| a[:email] <=> b[:email] }
|
8
|
-
return display JSON.pretty_generate(users || []) if @options[:json]
|
9
|
-
|
10
|
-
display "\n"
|
11
|
-
return display "No Users" if users.nil? || users.empty?
|
12
|
-
|
13
|
-
users_table = table do |t|
|
14
|
-
t.headings = 'Email', 'Admin', 'Apps'
|
15
|
-
users.each do |user|
|
16
|
-
t << [user[:email], user[:admin], user[:apps].map {|x| x[:name]}.join(', ')]
|
17
|
-
end
|
18
|
-
end
|
19
|
-
display users_table
|
20
|
-
end
|
21
|
-
|
22
|
-
alias :users :list_users
|
23
|
-
|
24
|
-
def add_user(email=nil)
|
25
|
-
email ||= @options[:email]
|
26
|
-
email ||= ask("Email") unless no_prompt
|
27
|
-
password = @options[:password]
|
28
|
-
unless no_prompt || password
|
29
|
-
password = ask("Password", :echo => "*")
|
30
|
-
password2 = ask("Verify Password", :echo => "*")
|
31
|
-
err "Passwords did not match, try again" if password != password2
|
32
|
-
end
|
33
|
-
err "Need a valid email" unless email
|
34
|
-
err "Need a password" unless password
|
35
|
-
display 'Creating New User: ', false
|
36
|
-
client.add_user(email, password)
|
37
|
-
display 'OK'.green
|
38
|
-
|
39
|
-
# if we are not logged in for the current target, log in as the new user
|
40
|
-
return unless VMC::Cli::Config.auth_token.nil?
|
41
|
-
@options[:password] = password
|
42
|
-
cmd = User.new(@options)
|
43
|
-
cmd.login(email)
|
44
|
-
end
|
45
|
-
|
46
|
-
def delete_user(user_email)
|
47
|
-
# Check to make sure all apps and services are deleted before deleting the user
|
48
|
-
# implicit proxying
|
49
|
-
|
50
|
-
client.proxy_for(user_email)
|
51
|
-
@options[:proxy] = user_email
|
52
|
-
apps = client.apps
|
53
|
-
|
54
|
-
if (apps && !apps.empty?)
|
55
|
-
unless no_prompt
|
56
|
-
proceed = ask(
|
57
|
-
"\nDeployed applications and associated services will be DELETED, continue?",
|
58
|
-
:default => false
|
59
|
-
)
|
60
|
-
err "Aborted" unless proceed
|
61
|
-
end
|
62
|
-
cmd = Apps.new(@options.merge({ :force => true }))
|
63
|
-
apps.each { |app| cmd.delete(app[:name]) }
|
64
|
-
end
|
65
|
-
|
66
|
-
services = client.services
|
67
|
-
if (services && !services.empty?)
|
68
|
-
cmd = Services.new(@options)
|
69
|
-
services.each { |s| cmd.delete_service(s[:name])}
|
70
|
-
end
|
71
|
-
|
72
|
-
display 'Deleting User: ', false
|
73
|
-
client.proxy = nil
|
74
|
-
client.delete_user(user_email)
|
75
|
-
display 'OK'.green
|
76
|
-
end
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
1
|
+
module VMC::Cli::Command
|
2
|
+
|
3
|
+
class Admin < Base
|
4
|
+
|
5
|
+
def list_users
|
6
|
+
users = client.users
|
7
|
+
users.sort! {|a, b| a[:email] <=> b[:email] }
|
8
|
+
return display JSON.pretty_generate(users || []) if @options[:json]
|
9
|
+
|
10
|
+
display "\n"
|
11
|
+
return display "No Users" if users.nil? || users.empty?
|
12
|
+
|
13
|
+
users_table = table do |t|
|
14
|
+
t.headings = 'Email', 'Admin', 'Apps'
|
15
|
+
users.each do |user|
|
16
|
+
t << [user[:email], user[:admin], user[:apps].map {|x| x[:name]}.join(', ')]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
display users_table
|
20
|
+
end
|
21
|
+
|
22
|
+
alias :users :list_users
|
23
|
+
|
24
|
+
def add_user(email=nil)
|
25
|
+
email ||= @options[:email]
|
26
|
+
email ||= ask("Email") unless no_prompt
|
27
|
+
password = @options[:password]
|
28
|
+
unless no_prompt || password
|
29
|
+
password = ask("Password", :echo => "*")
|
30
|
+
password2 = ask("Verify Password", :echo => "*")
|
31
|
+
err "Passwords did not match, try again" if password != password2
|
32
|
+
end
|
33
|
+
err "Need a valid email" unless email
|
34
|
+
err "Need a password" unless password
|
35
|
+
display 'Creating New User: ', false
|
36
|
+
client.add_user(email, password)
|
37
|
+
display 'OK'.green
|
38
|
+
|
39
|
+
# if we are not logged in for the current target, log in as the new user
|
40
|
+
return unless VMC::Cli::Config.auth_token.nil?
|
41
|
+
@options[:password] = password
|
42
|
+
cmd = User.new(@options)
|
43
|
+
cmd.login(email)
|
44
|
+
end
|
45
|
+
|
46
|
+
def delete_user(user_email)
|
47
|
+
# Check to make sure all apps and services are deleted before deleting the user
|
48
|
+
# implicit proxying
|
49
|
+
|
50
|
+
client.proxy_for(user_email)
|
51
|
+
@options[:proxy] = user_email
|
52
|
+
apps = client.apps
|
53
|
+
|
54
|
+
if (apps && !apps.empty?)
|
55
|
+
unless no_prompt
|
56
|
+
proceed = ask(
|
57
|
+
"\nDeployed applications and associated services will be DELETED, continue?",
|
58
|
+
:default => false
|
59
|
+
)
|
60
|
+
err "Aborted" unless proceed
|
61
|
+
end
|
62
|
+
cmd = Apps.new(@options.merge({ :force => true }))
|
63
|
+
apps.each { |app| cmd.delete(app[:name]) }
|
64
|
+
end
|
65
|
+
|
66
|
+
services = client.services
|
67
|
+
if (services && !services.empty?)
|
68
|
+
cmd = Services.new(@options)
|
69
|
+
services.each { |s| cmd.delete_service(s[:name])}
|
70
|
+
end
|
71
|
+
|
72
|
+
display 'Deleting User: ', false
|
73
|
+
client.proxy = nil
|
74
|
+
client.delete_user(user_email)
|
75
|
+
display 'OK'.green
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
data/lib/cli/config.rb
CHANGED
@@ -58,11 +58,17 @@ module VMC::Cli
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def store_target(target_host)
|
61
|
+
target_host = "http://#{target_host}" unless /^https?/ =~ target_host
|
62
|
+
target_host = target_host.gsub(/\/+$/, '')
|
63
|
+
|
61
64
|
target_file = File.expand_path(TARGET_FILE)
|
62
65
|
lock_and_write(target_file, target_host)
|
63
66
|
end
|
64
67
|
|
65
68
|
def store_uhuru_target(host, uhuru_target)
|
69
|
+
host = "http://#{host}" unless /^https?/ =~ host
|
70
|
+
host = host.gsub(/\/+$/, '')
|
71
|
+
|
66
72
|
uhuru_target_urls = all_uhuru_targets || {}
|
67
73
|
uhuru_target_urls[host.to_sym] = uhuru_target
|
68
74
|
uhuru_target_file = File.expand_path(UHURU_TARGET_FILE)
|
data/lib/cli/usage.rb
CHANGED
@@ -1,118 +1,118 @@
|
|
1
|
-
class VMC::Cli::Runner
|
2
|
-
|
3
|
-
def basic_usage
|
4
|
-
"Usage: vmcu [options] command [<args>] [command_options]\n" +
|
5
|
-
"Try 'vmcu help [command]' or 'vmcu help options' for more information."
|
6
|
-
end
|
7
|
-
|
8
|
-
def display_usage
|
9
|
-
if @usage
|
10
|
-
say @usage_error if @usage_error
|
11
|
-
say "Usage: #{@usage}"
|
12
|
-
return
|
13
|
-
elsif @verb_usage
|
14
|
-
say @verb_usage
|
15
|
-
return
|
16
|
-
end
|
17
|
-
say command_usage
|
18
|
-
end
|
19
|
-
|
20
|
-
def command_usage
|
21
|
-
<<-USAGE
|
22
|
-
|
23
|
-
#{basic_usage}
|
24
|
-
|
25
|
-
Currently available vmcu commands are:
|
26
|
-
|
27
|
-
Getting Started
|
28
|
-
target [url] Reports current target or sets a new target
|
29
|
-
login [email] [--email, --passwd] Login
|
30
|
-
login [token] [--token UHURU_TOKEN] Login for Uhuru AppCloud
|
31
|
-
cloud-team [name or id] [--realm REALM] Set cloud team for Uhuru AppCloud. Sys admins can proxy realms
|
32
|
-
import-uhuru Import targets from Uhuru Cloud Foundry Manager
|
33
|
-
info System and account information
|
34
|
-
|
35
|
-
Applications
|
36
|
-
apps List deployed applications
|
37
|
-
|
38
|
-
Application Creation
|
39
|
-
push [appname] Create, push, map, and start a new application
|
40
|
-
push [appname] --path Push application from specified path
|
41
|
-
push [appname] --url Set the url for the application
|
42
|
-
push [appname] --instances <N> Set the expected number <N> of instances
|
43
|
-
push [appname] --mem M Set the memory reservation for the application
|
44
|
-
push [appname] --runtime RUNTIME Set the runtime to use for the application
|
45
|
-
push [appname] --debug [MODE] Push application and start in a debug mode
|
46
|
-
push [appname] --no-start Do not auto-start the application
|
47
|
-
|
48
|
-
Application Operations
|
49
|
-
start <appname> [--debug [MODE]] Start the application
|
50
|
-
stop <appname> Stop the application
|
51
|
-
restart <appname> [--debug [MODE]] Restart the application
|
52
|
-
delete <appname> Delete the application
|
53
|
-
|
54
|
-
Application Updates
|
55
|
-
update <appname> [--path,--debug [MODE]] Update the application bits
|
56
|
-
mem <appname> [memsize] Update the memory reservation for an application
|
57
|
-
map <appname> <url> Register the application to the url
|
58
|
-
unmap <appname> <url> Unregister the application from the url
|
59
|
-
instances <appname> <num|delta> Scale the application instances up or down
|
60
|
-
|
61
|
-
Application Information
|
62
|
-
crashes <appname> List recent application crashes
|
63
|
-
crashlogs <appname> Display log information for crashed applications
|
64
|
-
logs <appname> [--all] Display log information for the application
|
65
|
-
files <appname> [path] [--all] Display directory listing or file download for [path]
|
66
|
-
stats <appname> Display resource usage for the application
|
67
|
-
instances <appname> List application instances
|
68
|
-
|
69
|
-
Application Environment
|
70
|
-
env <appname> List application environment variables
|
71
|
-
env-add <appname> <variable[=]value> Add an environment variable to an application
|
72
|
-
env-del <appname> <variable> Delete an environment variable to an application
|
73
|
-
|
74
|
-
Services
|
75
|
-
services Lists of services available and provisioned
|
76
|
-
create-service <service> [--name,--bind] Create a provisioned service
|
77
|
-
create-service <service> <name> Create a provisioned service and assign it <name>
|
78
|
-
create-service <service> <name> <app> Create a provisioned service and assign it <name>, and bind to <app>
|
79
|
-
delete-service [servicename] Delete a provisioned service
|
80
|
-
bind-service <servicename> <appname> Bind a service to an application
|
81
|
-
unbind-service <servicename> <appname> Unbind service from the application
|
82
|
-
clone-services <src-app> <dest-app> Clone service bindings from <src-app> application to <dest-app>
|
83
|
-
tunnel <servicename> [--port] Create a local tunnel to a service
|
84
|
-
tunnel <servicename> <clientcmd> Create a local tunnel to a service and start a local client
|
85
|
-
|
86
|
-
Administration
|
87
|
-
user Display user account information
|
88
|
-
passwd Change the password for the current user
|
89
|
-
logout Logs current user out of the target system
|
90
|
-
add-user [--email, --passwd] Register a new user (requires admin privileges)
|
91
|
-
delete-user <user> Delete a user and all apps and services (requires admin privileges)
|
92
|
-
|
93
|
-
System
|
94
|
-
runtimes Display the supported runtimes of the target system
|
95
|
-
frameworks Display the recognized frameworks of the target system
|
96
|
-
|
97
|
-
Micro Cloud Foundry
|
98
|
-
micro status Display Micro Cloud Foundry VM status
|
99
|
-
micro offline Configure Micro Cloud Foundry VM for offline mode
|
100
|
-
micro online Configure Micro Cloud Foundry VM for online mode
|
101
|
-
[--vmx file] Path to micro.vmx
|
102
|
-
[--vmrun executable] Path to vmrun executable
|
103
|
-
[--password cleartext] Cleartext password for guest VM vcap user
|
104
|
-
[--save] Save cleartext password in ~/.vmc_micro
|
105
|
-
|
106
|
-
Misc
|
107
|
-
aliases List aliases
|
108
|
-
alias <alias[=]command> Create an alias for a command
|
109
|
-
unalias <alias> Remove an alias
|
110
|
-
targets List known targets and associated authorization tokens
|
111
|
-
|
112
|
-
Help
|
113
|
-
help [command] Get general help or help on a specific command
|
114
|
-
help options Get help on available options
|
115
|
-
USAGE
|
116
|
-
|
117
|
-
end
|
118
|
-
end
|
1
|
+
class VMC::Cli::Runner
|
2
|
+
|
3
|
+
def basic_usage
|
4
|
+
"Usage: vmcu [options] command [<args>] [command_options]\n" +
|
5
|
+
"Try 'vmcu help [command]' or 'vmcu help options' for more information."
|
6
|
+
end
|
7
|
+
|
8
|
+
def display_usage
|
9
|
+
if @usage
|
10
|
+
say @usage_error if @usage_error
|
11
|
+
say "Usage: #{@usage}"
|
12
|
+
return
|
13
|
+
elsif @verb_usage
|
14
|
+
say @verb_usage
|
15
|
+
return
|
16
|
+
end
|
17
|
+
say command_usage
|
18
|
+
end
|
19
|
+
|
20
|
+
def command_usage
|
21
|
+
<<-USAGE
|
22
|
+
|
23
|
+
#{basic_usage}
|
24
|
+
|
25
|
+
Currently available vmcu commands are:
|
26
|
+
|
27
|
+
Getting Started
|
28
|
+
target [url] Reports current target or sets a new target
|
29
|
+
login [email] [--email, --passwd] Login
|
30
|
+
login [token] [--token UHURU_TOKEN] Login for Uhuru AppCloud
|
31
|
+
cloud-team [name or id] [--realm REALM] Set cloud team for Uhuru AppCloud. Sys admins can proxy realms
|
32
|
+
import-uhuru Import targets from Uhuru Cloud Foundry Manager
|
33
|
+
info System and account information
|
34
|
+
|
35
|
+
Applications
|
36
|
+
apps List deployed applications
|
37
|
+
|
38
|
+
Application Creation
|
39
|
+
push [appname] Create, push, map, and start a new application
|
40
|
+
push [appname] --path Push application from specified path
|
41
|
+
push [appname] --url Set the url for the application
|
42
|
+
push [appname] --instances <N> Set the expected number <N> of instances
|
43
|
+
push [appname] --mem M Set the memory reservation for the application
|
44
|
+
push [appname] --runtime RUNTIME Set the runtime to use for the application
|
45
|
+
push [appname] --debug [MODE] Push application and start in a debug mode
|
46
|
+
push [appname] --no-start Do not auto-start the application
|
47
|
+
|
48
|
+
Application Operations
|
49
|
+
start <appname> [--debug [MODE]] Start the application
|
50
|
+
stop <appname> Stop the application
|
51
|
+
restart <appname> [--debug [MODE]] Restart the application
|
52
|
+
delete <appname> Delete the application
|
53
|
+
|
54
|
+
Application Updates
|
55
|
+
update <appname> [--path,--debug [MODE]] Update the application bits
|
56
|
+
mem <appname> [memsize] Update the memory reservation for an application
|
57
|
+
map <appname> <url> Register the application to the url
|
58
|
+
unmap <appname> <url> Unregister the application from the url
|
59
|
+
instances <appname> <num|delta> Scale the application instances up or down
|
60
|
+
|
61
|
+
Application Information
|
62
|
+
crashes <appname> List recent application crashes
|
63
|
+
crashlogs <appname> Display log information for crashed applications
|
64
|
+
logs <appname> [--all] Display log information for the application
|
65
|
+
files <appname> [path] [--all] Display directory listing or file download for [path]
|
66
|
+
stats <appname> Display resource usage for the application
|
67
|
+
instances <appname> List application instances
|
68
|
+
|
69
|
+
Application Environment
|
70
|
+
env <appname> List application environment variables
|
71
|
+
env-add <appname> <variable[=]value> Add an environment variable to an application
|
72
|
+
env-del <appname> <variable> Delete an environment variable to an application
|
73
|
+
|
74
|
+
Services
|
75
|
+
services Lists of services available and provisioned
|
76
|
+
create-service <service> [--name,--bind] Create a provisioned service
|
77
|
+
create-service <service> <name> Create a provisioned service and assign it <name>
|
78
|
+
create-service <service> <name> <app> Create a provisioned service and assign it <name>, and bind to <app>
|
79
|
+
delete-service [servicename] Delete a provisioned service
|
80
|
+
bind-service <servicename> <appname> Bind a service to an application
|
81
|
+
unbind-service <servicename> <appname> Unbind service from the application
|
82
|
+
clone-services <src-app> <dest-app> Clone service bindings from <src-app> application to <dest-app>
|
83
|
+
tunnel <servicename> [--port] Create a local tunnel to a service
|
84
|
+
tunnel <servicename> <clientcmd> Create a local tunnel to a service and start a local client
|
85
|
+
|
86
|
+
Administration
|
87
|
+
user Display user account information
|
88
|
+
passwd Change the password for the current user
|
89
|
+
logout Logs current user out of the target system
|
90
|
+
add-user [--email, --passwd] Register a new user (requires admin privileges)
|
91
|
+
delete-user <user> Delete a user and all apps and services (requires admin privileges)
|
92
|
+
|
93
|
+
System
|
94
|
+
runtimes Display the supported runtimes of the target system
|
95
|
+
frameworks Display the recognized frameworks of the target system
|
96
|
+
|
97
|
+
Micro Cloud Foundry
|
98
|
+
micro status Display Micro Cloud Foundry VM status
|
99
|
+
micro offline Configure Micro Cloud Foundry VM for offline mode
|
100
|
+
micro online Configure Micro Cloud Foundry VM for online mode
|
101
|
+
[--vmx file] Path to micro.vmx
|
102
|
+
[--vmrun executable] Path to vmrun executable
|
103
|
+
[--password cleartext] Cleartext password for guest VM vcap user
|
104
|
+
[--save] Save cleartext password in ~/.vmc_micro
|
105
|
+
|
106
|
+
Misc
|
107
|
+
aliases List aliases
|
108
|
+
alias <alias[=]command> Create an alias for a command
|
109
|
+
unalias <alias> Remove an alias
|
110
|
+
targets List known targets and associated authorization tokens
|
111
|
+
|
112
|
+
Help
|
113
|
+
help [command] Get general help or help on a specific command
|
114
|
+
help options Get help on available options
|
115
|
+
USAGE
|
116
|
+
|
117
|
+
end
|
118
|
+
end
|
data/lib/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vmcu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.20
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_pure
|