pi 0.1.20 → 0.1.21
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 +272 -86
- data/lib/cli/commands/apps.rb +2 -2
- data/lib/cli/usage.rb +11 -12
- data/lib/cli/version.rb +1 -1
- metadata +4 -4
data/README
CHANGED
@@ -58,19 +58,19 @@ _Copyright 2010-2012, Samsung.
|
|
58
58
|
Currently available pi commands are:
|
59
59
|
|
60
60
|
User
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
61
|
+
login [url] Login
|
62
|
+
logout Logs current user out of the system
|
63
|
+
info List system information
|
64
|
+
user Display user information
|
65
|
+
targets List available targets infomation
|
66
|
+
password [newpassword] Change the password for the current user
|
67
|
+
github [name] Bind to the github account
|
68
|
+
runtimes Display the supported runtimes of the system
|
69
|
+
frameworks Display the supported frameworks of the system
|
70
|
+
version Display version information
|
71
|
+
help [command] Get general help or help on a specific command
|
72
|
+
help options Get help on available options
|
73
|
+
|
74
74
|
Project
|
75
75
|
projects List created projects
|
76
76
|
create-project [projectname] Create a new project
|
@@ -107,14 +107,14 @@ _Copyright 2010-2012, Samsung.
|
|
107
107
|
|
108
108
|
4. Example
|
109
109
|
|
110
|
-
ubuntu@admin:~$ pi login
|
111
|
-
|
110
|
+
ubuntu@admin:~$ pi login
|
111
|
+
Attempting login to 'http://api.staging.samsungcloud.org'? [Yn]:
|
112
112
|
User: wangjing
|
113
113
|
Password: *******
|
114
114
|
Successfully logged into [http://api.staging.samsungcloud.org]
|
115
115
|
|
116
116
|
ubuntu@admin:~$ pi version
|
117
|
-
pi 0.1.
|
117
|
+
pi 0.1.21
|
118
118
|
|
119
119
|
ubuntu@admin:~$ pi user
|
120
120
|
|
@@ -127,12 +127,11 @@ Github Account Email: ruanzhimin@gmail.com
|
|
127
127
|
|
128
128
|
ubuntu@admin:~$ pi targets
|
129
129
|
|
130
|
-
|
131
|
-
| Name
|
132
|
-
|
133
|
-
|
|
134
|
-
|
135
|
-
+-----------------+-----------------------------------------+
|
130
|
+
+------------+------------------------------------+
|
131
|
+
| Name | URL |
|
132
|
+
+------------+------------------------------------+
|
133
|
+
| ap-ne-test | http://ap-ne-test.samsungcloud.org |
|
134
|
+
+------------+------------------------------------+
|
136
135
|
|
137
136
|
ubuntu@admin:~$ pi runtimes
|
138
137
|
|
@@ -175,18 +174,18 @@ Try 'pi help [command]' or 'pi help options' for more information.
|
|
175
174
|
Currently available pi commands are:
|
176
175
|
|
177
176
|
User
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
177
|
+
login [url] Login
|
178
|
+
logout Logs current user out of the system
|
179
|
+
info List system information
|
180
|
+
user Display user information
|
181
|
+
targets List available targets infomation
|
182
|
+
password [newpassword] Change the password for the current user
|
183
|
+
github [name] Bind to the github account
|
184
|
+
runtimes Display the supported runtimes of the system
|
185
|
+
frameworks Display the supported frameworks of the system
|
186
|
+
version Display version information
|
187
|
+
help [command] Get general help or help on a specific command
|
188
|
+
help options Get help on available options
|
190
189
|
|
191
190
|
Project
|
192
191
|
projects List created projects
|
@@ -198,6 +197,30 @@ Currently available pi commands are:
|
|
198
197
|
project-apps [projectname] List the applications for the project
|
199
198
|
upload [projectname] Upload the war package for java project
|
200
199
|
|
200
|
+
Application
|
201
|
+
apps List deployed applications for the project
|
202
|
+
create-app [appname] Create a new application
|
203
|
+
delete-app [appid] Delete the application
|
204
|
+
start-app [appid] Start the application
|
205
|
+
stop-app [appid] Stop the application
|
206
|
+
restart-app [appid] Restart the application
|
207
|
+
scale-app [appid] Scale the application instances up or down
|
208
|
+
update-app [appid] Update the application
|
209
|
+
status [appname] Display resource usage for the application
|
210
|
+
app-env [appid] Display the environments for the application
|
211
|
+
create-env [appid] Create the environment for the application
|
212
|
+
delete-env [appid] Delete the environment for the application
|
213
|
+
app-log [appid] List the logs for the application
|
214
|
+
|
215
|
+
Service
|
216
|
+
app-service [appname] Display the bind services for the application
|
217
|
+
bind-service [appname] Bind a service to an application
|
218
|
+
unbind-service [appname] Unbind a service to an application
|
219
|
+
DNS
|
220
|
+
app-dns [appname] Display the mapped urls for the application
|
221
|
+
map-dns [appname] Map the url for the application
|
222
|
+
unmap-dns [appname] Unmap the url for the application
|
223
|
+
|
201
224
|
ubuntu@admin:~$ pi help options
|
202
225
|
|
203
226
|
Available options:
|
@@ -213,57 +236,220 @@ Available options:
|
|
213
236
|
|
214
237
|
ubuntu@admin:~$ pi projects
|
215
238
|
|
216
|
-
|
217
|
-
| Name | Runtime | Framework | Git Type | GitUrl | Description |
|
218
|
-
|
219
|
-
| javatest | java | spring | cloudpi | http://wangjing@git-staging.samsungcloud.org/wangjing/javatest.git | test |
|
220
|
-
| javatestgithub | java | spring | github |
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
239
|
+
+-----------------+---------+-----------+----------+---------------------------------------------------------------------+------+-------------+
|
240
|
+
| Name | Runtime | Framework | Git Type | GitUrl | ID | Description |
|
241
|
+
+-----------------+---------+-----------+----------+---------------------------------------------------------------------+------+-------------+
|
242
|
+
| javatest | java | spring | cloudpi | http://wangjing@git-staging.samsungcloud.org/wangjing/javatest.git | 1955 | test |
|
243
|
+
| javatestgithub | java | spring | github | https://ruanzhimin@github.com/ruanzhimin/javatestgithub.git | 1931 | test |
|
244
|
+
| javawj | java | spring | cloudpi | http://wangjing@git-staging.samsungcloud.org/wangjing/javawj.git | 2031 | test |
|
245
|
+
| railstest | ruby18 | rails3 | cloudpi | http://wangjing@git-staging.samsungcloud.org/wangjing/railstest.git | 1928 | test |
|
246
|
+
| railstestgithub | ruby18 | rails3 | github | https://ruanzhimin@github.com/ruanzhimin/railstestgithub.git | 1929 | test |
|
247
|
+
| railswj | ruby18 | rails3 | cloudpi | http://wangjing@git-staging.samsungcloud.org/wangjing/railswj.git | 2028 | test |
|
248
|
+
| tmp1 | ruby18 | rails | cloudpi | http://wangjing@git-staging.samsungcloud.org/wangjing/tmp1.git | 1882 | test |
|
249
|
+
+-----------------+---------+-----------+----------+---------------------------------------------------------------------+------+-------------+
|
225
250
|
|
226
251
|
ubuntu@admin:~$ pi create-project
|
227
|
-
Project Name:
|
228
|
-
Project 'javatest' already exists.
|
229
|
-
Project Name: javademogithub
|
252
|
+
Project Name: railsdemo
|
230
253
|
=============Runtime============
|
231
254
|
1. java
|
232
255
|
2. ruby18
|
233
|
-
Select Runtime:
|
234
|
-
Selected Runtime:
|
256
|
+
Select Runtime: 2
|
257
|
+
Selected Runtime: ruby18
|
235
258
|
=============Frameworks============
|
236
|
-
1.
|
237
|
-
2.
|
238
|
-
|
239
|
-
|
240
|
-
Select Framework: 2
|
241
|
-
Selected Framework: spring
|
259
|
+
1. rails3
|
260
|
+
2. sinatra
|
261
|
+
Select Framework: 1
|
262
|
+
Selected Framework: rails3
|
242
263
|
Please enter in the description: test
|
243
264
|
=============Repository Types============
|
244
265
|
1. cloudpi
|
245
266
|
2. github
|
246
|
-
Select Repository Type:
|
247
|
-
Selected Repository Type:
|
248
|
-
|
249
|
-
1. public
|
250
|
-
2. private
|
251
|
-
Select publish Type: 1
|
252
|
-
Selected publish Type: public
|
253
|
-
Creating project javademogithub: OK
|
267
|
+
Select Repository Type: 1
|
268
|
+
Selected Repository Type: cloudpi
|
269
|
+
Creating project "railsdemo": ...........OK
|
254
270
|
|
255
|
-
ubuntu@admin:~$ pi
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
271
|
+
ubuntu@admin:~$ pi create-app
|
272
|
+
Application Name: railsdemo
|
273
|
+
=============Project Name===========
|
274
|
+
1. javatest
|
275
|
+
2. javatestgithub
|
276
|
+
3. javawj
|
277
|
+
4. railsdemo
|
278
|
+
5. railstest
|
279
|
+
6. railstestgithub
|
280
|
+
7. railswj
|
281
|
+
8. tmp1
|
282
|
+
Select Project: 4
|
283
|
+
Selected Project: railsdemo
|
284
|
+
Tag: v0.0.0
|
285
|
+
=============Targets============
|
286
|
+
1. ap-ne-test-http://ap-ne-test.samsungcloud.org
|
287
|
+
Select Target: 1
|
288
|
+
Selected Target: ap-ne-test-http://ap-ne-test.samsungcloud.org
|
289
|
+
Available memory: 5568 M
|
290
|
+
URL: railsdemo.wangjing.ap-ne-test.samsungpaas.com
|
291
|
+
Memory reservation (64M, 128M, 256M, 512M, 1G, 2G) [64M]:
|
292
|
+
How many instances? [1]:
|
293
|
+
Need restart? [yN]:
|
294
|
+
Need monitor? [yN]:
|
295
|
+
Branch: master
|
296
|
+
Creating application "railsdemo": .....................................................OK
|
297
|
+
|
298
|
+
ubuntu@admin:~$ pi apps
|
299
|
+
=============Project Name===========
|
300
|
+
1. javatest
|
301
|
+
2. javatestgithub
|
302
|
+
3. javawj
|
303
|
+
4. railsdemo
|
304
|
+
5. railstest
|
305
|
+
6. railstestgithub
|
306
|
+
7. railswj
|
307
|
+
8. tmp1
|
308
|
+
Select Project: 4
|
309
|
+
Selected Project: railsdemo
|
310
|
+
+------------+-----------+-----------------------------------------------+-------------+---------+---------+-----------+-------------------+
|
311
|
+
| Target | App name | URL | Deploy Type | Version | Status | Instances | Running Instances |
|
312
|
+
+------------+-----------+-----------------------------------------------+-------------+---------+---------+-----------+-------------------+
|
313
|
+
| ap-ne-test | railsdemo | railsdemo.wangjing.ap-ne-test.samsungpaas.com | git | v0.0.0 | STARTED | 1 | 1 |
|
314
|
+
+------------+-----------+-----------------------------------------------+-------------+---------+---------+-----------+-------------------+
|
315
|
+
|
316
|
+
ubuntu@admin:~$ pi stop-app
|
317
|
+
=============Project Name===========
|
318
|
+
1. javatest
|
319
|
+
2. javatestgithub
|
320
|
+
3. javawj
|
321
|
+
4. railsdemo
|
322
|
+
5. railstest
|
323
|
+
6. railstestgithub
|
324
|
+
7. railswj
|
325
|
+
8. tmp1
|
326
|
+
Select Project: 4
|
327
|
+
Selected Project: railsdemo
|
328
|
+
=============Application Name===========
|
329
|
+
1. railsdemo
|
330
|
+
Select Application: 1
|
331
|
+
Selected Application: railsdemo
|
332
|
+
Stoping application: OK
|
333
|
+
|
334
|
+
ubuntu@admin:~$ pi start-app
|
335
|
+
=============Project Name===========
|
336
|
+
1. javatest
|
337
|
+
2. javatestgithub
|
338
|
+
3. javawj
|
339
|
+
4. railsdemo
|
340
|
+
5. railstest
|
341
|
+
6. railstestgithub
|
342
|
+
7. railswj
|
343
|
+
8. tmp1
|
344
|
+
Select Project: 4
|
345
|
+
Selected Project: railsdemo
|
346
|
+
=============Application Name===========
|
347
|
+
1. railsdemo
|
348
|
+
Select Application: 1
|
349
|
+
Selected Application: railsdemo
|
350
|
+
Starting application: ................................OK
|
351
|
+
|
352
|
+
ubuntu@admin:~$ pi scale-app
|
353
|
+
=============Project Name===========
|
354
|
+
1. javatest
|
355
|
+
2. javatestgithub
|
356
|
+
3. javawj
|
357
|
+
4. railsdemo
|
358
|
+
5. railstest
|
359
|
+
6. railstestgithub
|
360
|
+
7. railswj
|
361
|
+
8. tmp1
|
362
|
+
Select Project: 4
|
363
|
+
Selected Project: railsdemo
|
364
|
+
=============Application Name===========
|
365
|
+
1. railsdemo
|
366
|
+
Select Application: 1
|
367
|
+
Selected Application: railsdemo
|
368
|
+
How many instances? [1]: 3
|
369
|
+
Scaling application: .....................OK
|
370
|
+
|
371
|
+
ubuntu@admin:~$ pi create-env railsdemo
|
372
|
+
Environment Name: aa
|
373
|
+
Environment Value: bb
|
374
|
+
OK
|
375
|
+
|
376
|
+
ubuntu@admin:~$ pi app-env railsdemo
|
377
|
+
+------+-------+
|
378
|
+
| Name | Value |
|
379
|
+
+------+-------+
|
380
|
+
| aa | bb |
|
381
|
+
+------+-------+
|
382
|
+
|
383
|
+
ubuntu@admin:~$ pi delete-env railsdemo
|
384
|
+
Environment Name: aa
|
385
|
+
OK
|
386
|
+
|
387
|
+
ubuntu@admin:~$ pi app-log
|
388
|
+
=============Project Name===========
|
389
|
+
1. javatest
|
390
|
+
2. javatestgithub
|
391
|
+
3. javawj
|
392
|
+
4. railsdemo
|
393
|
+
5. railstest
|
394
|
+
6. railstestgithub
|
395
|
+
7. railswj
|
396
|
+
8. tmp1
|
397
|
+
Select Project: 4
|
398
|
+
Selected Project: railsdemo
|
399
|
+
=============Application Name===========
|
400
|
+
1. railsdemo
|
401
|
+
Select Application: 1
|
402
|
+
Selected Application: railsdemo
|
403
|
+
Select instance index(from 0 to 2) [0]: 2
|
404
|
+
1: migration.log 578B
|
405
|
+
2: staging.log 966B
|
406
|
+
3: stderr.log 185B
|
407
|
+
4: stdout.log 148B
|
408
|
+
Select logs, indexed list?: 1
|
409
|
+
Selected logs: migration.log
|
410
|
+
|
411
|
+
WARNING: Global access to Rake DSL methods is deprecated. Please include
|
412
|
+
... Rake::DSL into classes and modules which use the Rake DSL methods.
|
413
|
+
WARNING: DSL method Railshelloworld::Application#task called at /mnt/vcap.local/dea/apps/railsdemo-2-ef9982b6297fc51c2d4d4ca0f763bd71/app/rubygems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:214:in `initialize_tasks'
|
414
|
+
** Invoke db:migrate (first_time)
|
415
|
+
** Invoke environment (first_time)
|
416
|
+
** Execute environment
|
417
|
+
** Execute db:migrate
|
418
|
+
** Invoke db:schema:dump (first_time)
|
419
|
+
** Invoke environment
|
420
|
+
** Execute db:schema:dump
|
421
|
+
|
422
|
+
ubuntu@admin:~$ pi delete-app
|
423
|
+
=============Project Name===========
|
424
|
+
1. javatest
|
425
|
+
2. javatestgithub
|
426
|
+
3. javawj
|
427
|
+
4. railsdemo
|
428
|
+
5. railstest
|
429
|
+
6. railstestgithub
|
430
|
+
7. railswj
|
431
|
+
8. tmp1
|
432
|
+
Select Project: 4
|
433
|
+
Selected Project: railsdemo
|
434
|
+
=============Application Name===========
|
435
|
+
1. railsdemo
|
436
|
+
Select Application: 1
|
437
|
+
Selected Application: railsdemo
|
438
|
+
Deleting application: ........OK
|
266
439
|
|
440
|
+
ubuntu@admin:~$ pi delete-project
|
441
|
+
=============Project Name===========
|
442
|
+
1. javatest
|
443
|
+
2. javatestgithub
|
444
|
+
3. javawj
|
445
|
+
4. railsdemo
|
446
|
+
5. railstest
|
447
|
+
6. railstestgithub
|
448
|
+
7. railswj
|
449
|
+
8. tmp1
|
450
|
+
Select Project: 4
|
451
|
+
Selected Project: railsdemo
|
452
|
+
Deleting project "railsdemo": .......OK
|
267
453
|
|
268
454
|
ubuntu@admin:~$ pi project-apps
|
269
455
|
=============Project Name=======
|
@@ -327,16 +513,15 @@ ubuntu@admin:~$ pi upload
|
|
327
513
|
=============Project Name=======
|
328
514
|
1. javatest
|
329
515
|
2. javatestgithub
|
516
|
+
3. javawj
|
330
517
|
Select Project: 1
|
331
518
|
Selected Project: javatest
|
332
519
|
Please enter the version: v1
|
333
520
|
Please enter in the description: test
|
334
|
-
Please enter the path of upload war file: /home/
|
335
|
-
|
336
|
-
Please enter the path of upload war file: /home/ubuntu/demo
|
337
|
-
|
338
|
-
? /home/ubuntu/demo.war
|
339
|
-
Uploading OK
|
521
|
+
Please enter the path of upload war file: /home/wangjing/sample.war
|
522
|
+
Not war file or path does not exist!
|
523
|
+
Please enter the path of upload war file: /home/ubuntu/demo.war
|
524
|
+
Uploading "demo.war": .OK
|
340
525
|
|
341
526
|
ubuntu@admin:~$ pi logout
|
342
527
|
Successfully logged out of [http://api.staging.samsungcloud.org]
|
@@ -344,19 +529,20 @@ Successfully logged out of [http://api.staging.samsungcloud.org]
|
|
344
529
|
5. Common Exception
|
345
530
|
|
346
531
|
ubuntu@admin:~$ pi login
|
347
|
-
|
348
|
-
URL: http://test.org
|
532
|
+
Attempting login to 'http://api.staging.samsungcloud.org'? [Yn]: n
|
533
|
+
Please input URL: http://test.org
|
349
534
|
User: wangjing
|
350
535
|
Password: *******
|
351
536
|
Problem with login, Cannot access target (getaddrinfo: Name or service not known), try again or register for an account.
|
352
537
|
|
353
|
-
ubuntu@admin:~$ pi github
|
538
|
+
ubuntu@admin:~$ pi github
|
354
539
|
Please input your name: ruanzhimin
|
355
540
|
Please input your email: ruanzhimin@gmail.com
|
356
|
-
Please input your password:
|
357
|
-
|
541
|
+
Please input your password: ***
|
542
|
+
|
543
|
+
Error (1007): Invalid github account.
|
358
544
|
|
359
545
|
ubuntu@admin:~$ pi project-events tmp4
|
360
|
-
|
361
|
-
not belongs to current account.Project name : tmp4
|
546
|
+
|
547
|
+
Error (3004): The project is not belongs to current account.Project name : tmp4
|
362
548
|
|
data/lib/cli/commands/apps.rb
CHANGED
@@ -435,9 +435,9 @@ module PI::Cli::Command
|
|
435
435
|
return display JSON.pretty_generate(status) if @options[:json]
|
436
436
|
return display "No Status!" if status.nil? || status.empty?
|
437
437
|
status_table = table do |t|
|
438
|
-
t.headings = 'Instance ID', 'CPU', 'Memory', 'Disk', 'RequestCount', 'ErrorCount'
|
438
|
+
t.headings = 'Instance ID', 'Status', 'CPU(%)', 'Memory(M)', 'Disk(M)', 'RequestCount', 'ErrorCount'
|
439
439
|
status.each do |s|
|
440
|
-
t << [s[:instancesId], s[:cpu], s[:memory], s[:disk], s[:requestCount], s[:errorCount]]
|
440
|
+
t << [s[:instancesId][0,6], s[:status], s[:cpu], s[:memory], s[:disk], s[:requestCount], s[:errorCount]]
|
441
441
|
end
|
442
442
|
end
|
443
443
|
display status_table
|
data/lib/cli/usage.rb
CHANGED
@@ -25,18 +25,17 @@ class PI::Cli::Runner
|
|
25
25
|
Currently available pi commands are:
|
26
26
|
|
27
27
|
User
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
pi help options Get help on available options
|
28
|
+
login [url] Login
|
29
|
+
logout Logs current user out of the system
|
30
|
+
info List system information
|
31
|
+
user Display user information
|
32
|
+
targets List available targets infomation
|
33
|
+
github [name] Bind to the github account
|
34
|
+
runtimes Display the supported runtimes of the system
|
35
|
+
frameworks Display the supported frameworks of the system
|
36
|
+
version Display version information
|
37
|
+
help [command] Get general help or help on a specific command
|
38
|
+
help options Get help on available options
|
40
39
|
|
41
40
|
Project
|
42
41
|
projects List created projects
|
data/lib/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 49
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 21
|
10
|
+
version: 0.1.21
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Samsung
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-07-
|
18
|
+
date: 2012-07-20 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json_pure
|