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 CHANGED
@@ -58,19 +58,19 @@ _Copyright 2010-2012, Samsung.
58
58
  Currently available pi commands are:
59
59
 
60
60
  User
61
- pi login [url] Login
62
- pi logout Logs current user out of the system
63
- pi info List system information
64
- pi user Display user information
65
- pi targets List available targets infomation
66
- pi password [newpassword] Change the password for the current user
67
- pi github [name] Bind to the github account
68
- pi runtimes Display the supported runtimes of the system
69
- pi frameworks Display the supported frameworks of the system
70
- pi version Display version information
71
- pi help [command] Get general help or help on a specific command
72
- pi help options Get help on available options
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
- URL: 'http://api.staging.samsungcloud.org'? y
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.20
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 | URL |
132
- +-----------------+-----------------------------------------+
133
- | us-east-staging | http://us-east-staging.samsungcloud.org |
134
- | ap-ne-test | http://ap-ne-test.samsungcloud.org |
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
- pi login [url] Login
179
- pi logout Logs current user out of the system
180
- pi info List system information
181
- pi user Display user information
182
- pi targets List available targets infomation
183
- pi password [newpassword] Change the password for the current user
184
- pi github [name] Bind to the github account
185
- pi runtimes Display the supported runtimes of the system
186
- pi frameworks Display the supported frameworks of the system
187
- pi version Display version information
188
- pi help [command] Get general help or help on a specific command
189
- pi help options Get help on available options
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 | git://github.com/ruanzhimin/javatestgithub.git | test |
221
- | railstest | ruby18 | rails3 | cloudpi | http://wangjing@git-staging.samsungcloud.org/wangjing/railstest.git | test |
222
- | railstestgithub | ruby18 | rails3 | github | git://github.com/ruanzhimin/railstestgithub.git | test |
223
- | tmp1 | ruby18 | rails | cloudpi | http://wangjing@git-staging.samsungcloud.org/wangjing/tmp1.git | test |
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: javatest
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: 1
234
- Selected Runtime: java
256
+ Select Runtime: 2
257
+ Selected Runtime: ruby18
235
258
  =============Frameworks============
236
- 1. lift
237
- 2. spring
238
- 3. grails
239
- 4. java_web
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: 2
247
- Selected Repository Type: github
248
- =============Publish Types============
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 delete-project
256
- =============Project Name=======
257
- 1. javademogithub
258
- 2. javatest
259
- 3. javatestgithub
260
- 4. railstest
261
- 5. railstestgithub
262
- 6. tmp1
263
- Select Project: 1
264
- Selected Project: javademogithub
265
- Deleting project [javademogithub]: OK
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/demo.war
335
- Deployment path does not exist!
336
- Please enter the path of upload war file: /home/ubuntu/demo
337
- Please enter the path of upload war file:
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
- URL: 'http://api.staging.samsungcloud.org'? n
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
- Error (HTTP 500): {"httpCode":500,"errorCode":1007,"httpDescription":"Internal Server Error","errorDescription":"Invalid github account."}
541
+ Please input your password: ***
542
+
543
+ Error (1007): Invalid github account.
358
544
 
359
545
  ubuntu@admin:~$ pi project-events tmp4
360
- Error (HTTP 500): {"httpCode":500,"errorCode":3004,"httpDescription":"Internal Server Error","errorDescription":"The project is
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
 
@@ -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
@@ -25,18 +25,17 @@ class PI::Cli::Runner
25
25
  Currently available pi commands are:
26
26
 
27
27
  User
28
- pi login [url] Login
29
- pi logout Logs current user out of the system
30
- pi info List system information
31
- pi user Display user information
32
- pi targets List available targets infomation
33
- pi password [newpassword] Change the password for the current user
34
- pi github [name] Bind to the github account
35
- pi runtimes Display the supported runtimes of the system
36
- pi frameworks Display the supported frameworks of the system
37
- pi version Display version information
38
- pi help [command] Get general help or help on a specific command
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
@@ -1,5 +1,5 @@
1
1
  module PI
2
2
  module Cli
3
- VERSION = '0.1.20'
3
+ VERSION = '0.1.21'
4
4
  end
5
5
  end
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: 51
4
+ hash: 49
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 20
10
- version: 0.1.20
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-19 00:00:00 Z
18
+ date: 2012-07-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json_pure