PI
This is the command line interface to CloudPi Cloud Application Platform
_Copyright 2010-2012, Samsung.
-
For Users
1.1 Prerequisite: Installing Ruby and RubyGems
Currently support Ruby version v1.8.7 and v1.9.2
Installing Ruby and RubyGems on Windows and Linux computers(If you have already installed Ruby and RubyGems, then you can skip to Installing pi Steps):
Windows:
Download and install Ruby Installer for Windows from www.rubyinstaller.org. The installer already includes RubyGems. Be sure you use the Ruby-enabled command prompt window when you later install and use pi. You access this command prompt from the Windows Start menu (All Programs > Ruby <version> > Start Command Prompt with Ruby). Linux: Install the full Ruby package and RubyGems: $ apt-get install ruby-full rubygems $ ruby -v $ gem -v 1.2 Installing pi
$ gem install pi
$ pi version
1.3 Quick Start
To get full help for pi command line, run:
$ pi help
To get info for pi command line, run:
$ pi info
To login, run:
$ pi login
-
For Developers
2.1 Dependency
"json_pure", "~> 1.5.1"
"highline", "~> 1.6.1"
"rest-client", ">= 1.6.1", "< 1.7.0"
"terminal-table", "~> 1.4.2"
"interact", "~> 0.4.0"
2.2 Creating Your Own Gem
If you want to use your own pi command line based on currently pi command line, you can rewrite your own code, then create a gem. You can refer to RubyGems Manuals (http://docs.rubygems.org/read/chapter/5). Here are simple steps:
a.create a gem specification(for example, you can define my_pi.gemspec)
b.$ gem build my_pi.gemspec, after that my_pi.gem is created.
c.$ gem push my_pi-1.0.0.gem, that will instantly deploy your gem to the rubygems.org servers, and other users will be able to install it using gem install.
d.$ gem install my_pi.gem
-
Help
"Usage: pi [options] command [<args>] [command_options]\n" + "Try 'pi help [command]' or 'pi help options' for more information."
Currently available pi commands are:
User
login [url] [--user,--password] Login
logout Logs current user out of the system
info List system information
user Display user information
targets List available targets infomation
password [oldpassword] [--password PASS] Change the password for the current user
github [name] [--email,--password] Bind to the github account
runtimes Display the supported runtimes of the system
frameworks Display the supported frameworks of the system
version Display version information
help [command] Get general help or help on a specific command
help options Get help on available options
Project
projects List created projects
create-project [project] Create a new project
delete-project [projectid] Delete the project
project-events [projectid] List the event info for the project
project-tags [projectid] List the tags for the project
project-commits [projectid] List the commit log for the project
upload [projectid] [--path,--ver,--desc] Upload the war package for java project
Application
apps [--projectid,--target] List deployed applications
create-app [appname] Create a new application
delete-app [appid] Delete the application
delete-app <appname> <--target TARGET> Delete the application
start-app [appid] Start the application
start-app <appname> <--target TARGET> Start the application
stop-app [appid] Stop the application
stop-app <appname> <--target TARGET> Stop the application
stop-app --graceful Stop the application in a graceful mode
restart-app [appid] Restart the application
restart-app <appname> <--target TARGET> Restart the application
restart-app --graceful --lazy Restart the application in a graceful and lazy mode
scale-app [appid] [--instance N] Scale the application instances up or down
scale-app <appname> <--target TARGET> [--instance N] Scale the application instances up or down
scale-app --graceful Scale the application instances in a graceful mode
update-app [appid] [--ver VERSION] Update the application
update-app <appname> <--target TARGET> [--ver VERSION] Update the application
update-app --graceful --lazy Update the application in a graceful and lazy mode
status [appid] Display resource usage for the application
status <appname> <--target TARGET> Display resource usage for the application
app-env [appid] Display the environments for the application
app-env <appname> <--target TARGET> Display the environments for the application
create-env [appid] [--name,--value] Create the environment for the application
create-env <appname> <--target TARGET> [--name,--value] Create the environment for the application
delete-env [appid] [--name NAME] Delete the environment for the application
delete-env <appname> <--target TARGET> [--name NAME] Delete the environment for the application
app-log [appid] [--instanceid,--file] List the logs for the application
app-log <appname> <--target TARGET> [--instanceid,--file] List the logs for the application
app-debug [appid] List the debug info for the application
app-debug <appname> <--target TARGET> List the debug info for the application
Service
app-service [appid] Display the binded services for the application
app-service <appname> <--target TARGET> Display the binded services for the application
bind-service [appid] [--service SERVICE] Bind the services for the application
bind-service <appname> <--target TARGET> [--service] Bind the services for the application
bind-service --graceful --lazy Bind the services for the application in a graceful and lazy mode
unbind-service [appid] [--service SERVICE] Unbind the services for the application
unbind-service <appname> <--target TARGET> [--service] Unbind the services for the application
unbind-service --graceful --lazy Unbind the services for the application in a graceful and lazy mode
services List dedicated services
service [serviceid] List the connection info for the service
export-service [serviceid] Export dedicated service url
import-service [url] Import dedicated service
check-service [serviceid] Check availability for the service
delete-service [serviceid] Delete the service
register-service [serviceid] [--target,--type] Register to target
deregister-service [serviceid] [--target TARGET] Deregister to target
DNS
app-dns [appid] Display the mapped urls for the application
app-dns <appname> <--target TARGET> Display the mapped urls for the application
map-dns [appid] [--dns DNS] Map the urls for the application
map-dns <appname> <--target TARGET> [--dns DNS] Map the urls for the application
unmap-dns [appid] [--dns DNS] Unmap the urls for the application
unmap-dns <appname> <--target TARGET> [--dns DNS] Unmap the urls for the application
dns List the dns
zones List the dns zones
create-dns [dnsname] [--zoneid,--projectid,--desc] Create a new dns
register-dns [dnsid] [--target,--continent,--country] Register to target
deregister-dns [dnsid] [--recordid ID] Deregister to target
delete-dns [dnsid] Delete the dns
-
Example
ubuntu@admin:~$ pi login Attempting login to ‘staging.samsungcloud.org’? [Yn]: User: wangjing Password: ******* Successfully logged into [staging.samsungcloud.org]
ubuntu@admin:~$ pi login staging.samsungcloud.org –user wangjing –password cloudpi Successfully logged into [staging.samsungcloud.org]
ubuntu@admin:~$ pi version pi 0.1.27
ubuntu@admin:~$ pi user
UserName: wangjing DomainName: bst RoleName: user State: Active Github Account Name: ruanzhimin Github Account Email: [email protected]
ubuntu@admin:~$ pi targets
-----------
———————————–+ | Name | URL | -----------
———————————–+ | bst-dev | bst-dev.samsungcloud.org | | target-hq | target-hq.samsungcloud.org | -----------
———————————–+
ubuntu@admin:~$ pi password Old Password: ******* New Password: **** Verify Password: **** ok
ubuntu@admin:~$ pi runtimes
--------
| Name | --------
| java | | ruby18 | --------
ubuntu@admin:~$ pi frameworks
----------
| Name | ----------
| lift | | spring | | grails | | java_web | | rails3 | | sinatra | ----------
ubuntu@admin:~$ pi github Please input your name: ruanzhimin Please input your email: [email protected] Please input your password: **************** ok
ubuntu@admin:~$ pi help
Usage: pi [options] command [<args>] [command_options] Try ‘pi help [command]’ or ‘pi help options’ for more information.
Currently available pi commands are:
User
login [url] [--user,--password] Login
logout Logs current user out of the system
info List system information
user Display user information
targets List available targets infomation
password [oldpassword] [--password PASS] Change the password for the current user
github [name] [--email,--password] Bind to the github account
runtimes Display the supported runtimes of the system
frameworks Display the supported frameworks of the system
version Display version information
help [command] Get general help or help on a specific command
help options Get help on available options
Project
projects List created projects
create-project [project] Create a new project
delete-project [projectid] Delete the project
project-events [projectid] List the event info for the project
project-tags [projectid] List the tags for the project
project-commits [projectid] List the commit log for the project
upload [projectid] [--path,--ver,--desc] Upload the war package for java project
Application
apps [--projectid,--target] List deployed applications
create-app [appname] Create a new application
delete-app [appid] Delete the application
delete-app <appname> <--target TARGET> Delete the application
start-app [appid] Start the application
start-app <appname> <--target TARGET> Start the application
stop-app [appid] Stop the application
stop-app <appname> <--target TARGET> Stop the application
stop-app --graceful Stop the application in a graceful mode
restart-app [appid] Restart the application
restart-app <appname> <--target TARGET> Restart the application
restart-app --graceful --lazy Restart the application in a graceful and lazy mode
scale-app [appid] [--instance N] Scale the application instances up or down
scale-app <appname> <--target TARGET> [--instance N] Scale the application instances up or down
scale-app --graceful Scale the application instances in a graceful mode
update-app [appid] [--ver VERSION] Update the application
update-app <appname> <--target TARGET> [--ver VERSION] Update the application
update-app --graceful --lazy Update the application in a graceful and lazy mode
status [appid] Display resource usage for the application
status <appname> <--target TARGET> Display resource usage for the application
app-env [appid] Display the environments for the application
app-env <appname> <--target TARGET> Display the environments for the application
create-env [appid] [--name,--value] Create the environment for the application
create-env <appname> <--target TARGET> [--name,--value] Create the environment for the application
delete-env [appid] [--name NAME] Delete the environment for the application
delete-env <appname> <--target TARGET> [--name NAME] Delete the environment for the application
app-log [appid] [--instanceid,--file] List the logs for the application
app-log <appname> <--target TARGET> [--instanceid,--file] List the logs for the application
app-debug [appid] List the debug info for the application
app-debug <appname> <--target TARGET> List the debug info for the application
Service
app-service [appid] Display the binded services for the application
app-service <appname> <--target TARGET> Display the binded services for the application
bind-service [appid] [--service SERVICE] Bind the services for the application
bind-service <appname> <--target TARGET> [--service] Bind the services for the application
bind-service --graceful --lazy Bind the services for the application in a graceful and lazy mode
unbind-service [appid] [--service SERVICE] Unbind the services for the application
unbind-service <appname> <--target TARGET> [--service] Unbind the services for the application
unbind-service --graceful --lazy Unbind the services for the application in a graceful and lazy mode
services List dedicated services
service [serviceid] List the connection info for the service
export-service [serviceid] Export dedicated service url
import-service [url] Import dedicated service
check-service [serviceid] Check availability for the service
delete-service [serviceid] Delete the service
register-service [serviceid] [--target,--type] Register to target
deregister-service [serviceid] [--target TARGET] Deregister to target
DNS
app-dns [appid] Display the mapped urls for the application
app-dns <appname> <--target TARGET> Display the mapped urls for the application
map-dns [appid] [--dns DNS] Map the urls for the application
map-dns <appname> <--target TARGET> [--dns DNS] Map the urls for the application
unmap-dns [appid] [--dns DNS] Unmap the urls for the application
unmap-dns <appname> <--target TARGET> [--dns DNS] Unmap the urls for the application
dns List the dns
zones List the dns zones
create-dns [dnsname] [--zoneid,--projectid,--desc] Create a new dns
register-dns [dnsid] [--target,--continent,--country] Register to target
deregister-dns [dnsid] [--recordid ID] Deregister to target
delete-dns [dnsid] Delete the dns
ubuntu@admin:~$ pi help options
Available options:
--user USER
--password PASS
--name NAME
--email EMAIL
--path PATH
--ver VERSION
--desc DESC
--projectid ID
--target TARG
--instance N
--type TYPE
--value VALUE
--service SERVICE
--dns DNS
--zoneid ID
--instanceid N
--file FILE
--continent CONT
--country COUNTRY
--recordid ID
--graceful
--lazy
-t [TKEY]
--trace [TKEY]
-q, --quiet
--verbose
--json
-v, --version
-h, --help
--options
ubuntu@admin:~$ pi help stop-app Usage: pi stop-app [appid] [–graceful] or pi stop-app <appname> <–target TARGET> [–graceful]
ubuntu@admin:~$ pi projects
------
——————---------
———–----------
—————————————————————————--------------
| ID | Name | Runtime | Framework | Git Type | GitUrl | Description | ------
——————---------
———–----------
—————————————————————————--------------
| 2131 | javagithub | java | spring | github | [email protected]/ruanzhimin/javagithub.git | test | | 2193 | javawj | java | spring | cloudpi | [email protected]/wangjing/javawj.git | test | | 2132 | railsgithub | ruby18 | rails3 | github | [email protected]/ruanzhimin/railsgithub.git | test | | 2028 | railswj | ruby18 | rails3 | cloudpi | [email protected]/wangjing/railswj.git | test | | 2271 | sinatra | ruby18 | sinatra | cloudpi | [email protected]/wangjing/sinatra.git | test | | 2414 | sinatra4rabbitmq | ruby18 | sinatra | cloudpi | [email protected]/wangjing/sinatra4rabbitmq.git | test | | 2416 | sinatra4redis | ruby18 | sinatra | cloudpi | [email protected]/wangjing/sinatra4redis.git | test | ------
——————---------
———–----------
—————————————————————————--------------
ubuntu@admin:~$ pi create-project Project Name: java 1: java 2: ruby18 Select Runtime: 1 Selected Runtime: java 1: lift 2: spring 3: grails 4: java_web Select Framework: 2 Selected Framework: spring Please enter in the description: test 1: cloudpi 2: github Select Repository Type: 1 Selected Repository Type: cloudpi Creating project “java”: .….….…OK
ubuntu@admin:~$ pi upload 1: java 2: javagithub 3: javawj Select Project: 1 Selected Project: java Please enter the path of upload war file: /home/wangjing/paashelp.war Please enter the version: paashelp Please enter in the description: test Uploading “paashelp.war”: .OK
ubuntu@admin:~$ pi create-app 1: bst-dev 2: target-hq Select Target: 1 Selected Target: bst-dev Application Name: grails4redis 1: grails4membase 2: grails4redis 3: javagithub 4: javawj 5: railsgithub 6: railswj 7: sinatra 8: sinatra4rabbitmq 9: sinatra4redis 10: testdebug Select Project: 2 Selected Project: grails4redis 1: v3 Select Version: 1 Selected Version: v3 URL: grails4redis.wangjing.bst-dev.samsungpaas.com Memory reservation (64M, 128M, 256M, 512M, 1G, 2G) [64M]: Available memory: 1984 M, maximum instances: 31 How many instances(from 1 to 31)? [1]: Need debug? [yN]: y 1: restart 2: notify Reaction when service changed [notify]: 1 Need graceful? [Yn]: Need lazy? [Yn]: Need monitor? [yN]: y Creating application “grails4redis”: .….….….….….….….….….….….….….……Success to create appliation.
ubuntu@admin:~$ pi apps ------
———–--------------
————————————————--------------
———----------
———–-------------------
| ID | Target | App name | URL | Deploy Type | Version | Status | Instances | Running Instances | ------
———–--------------
————————————————--------------
———----------
———–-------------------
| 2270 | target-hq | grails4redis | grails4redis.wangjing.target-hq.samsungpaas.com | binary | v3 | STARTED | 1 | 0 | | 2413 | bst-dev | grails4redis | grails4redis.wangjing.bst-dev.samsungpaas.com | binary | v3 | STARTED | 1 | 1 | | 2399 | bst-dev | testdebug | testdebug.wangjing.bst-dev.samsungpaas.com | binary | paashelp | STARTED | 1 | 1 | ------
———–--------------
————————————————--------------
———----------
———–-------------------
ubuntu@admin:~$ pi apps –target bst-dev ------
———--------------
———————————————–-------------
———----------
———–-------------------
| ID | Target | App name | URL | Deploy Type | Version | Status | Instances | Running Instances | ------
———--------------
———————————————–-------------
———----------
———–-------------------
| 2413 | bst-dev | grails4redis | grails4redis.wangjing.bst-dev.samsungpaas.com | binary | v3 | STARTED | 1 | 1 | | 2399 | bst-dev | testdebug | testdebug.wangjing.bst-dev.samsungpaas.com | binary | paashelp | STARTED | 1 | 1 | ------
———--------------
———————————————–-------------
———----------
———–-------------------
ubuntu@admin:~$ pi stop-app 1: all 2: project 3: target Select application by: 1 Select application by all 1: grails4redis 2: testdebug 3: grails4redis Select Application: 2 Selected Application: testdebug Need graceful? [Yn]: Stoping application ‘testdebug’(target:bst-dev): OK
ubuntu@admin:~$ pi stop-app 1: all 2: project 3: target Select application by: 2 Select application by project 1: grails4membase 2: grails4redis 3: javagithub 4: javawj 5: railsgithub 6: railswj 7: sinatra 8: sinatra4rabbitmq 9: sinatra4redis 10: testdebug Select Project: 10 Selected Project: testdebug 1: testdebug Select Application: 1 Selected Application: testdebug The application ‘testdebug’(target:bst-dev) has already stopped.
ubuntu@admin:~$ pi stop-app 1: all 2: project 3: target Select application by: 3 Select application by target 1: bst-dev 2: target-hq Select Target: 1 Selected Target: bst-dev 1: testdebug 2: grails4redis Select Application: 2 Selected Application: grails4redis Need graceful? [Yn]: Stoping application ‘grails4redis’(target:bst-dev): OK
ubuntu@admin:~$ pi start-app grails4redis –target all The application ‘grails4redis’(target:target-hq) has already started. Starting application ‘grails4redis’(target:bst-dev): .….….….….….….….….….…..Success to start application.
ubuntu@admin:~$ pi restart-app testdebug –target bst-dev –graceful –lazy Restart application ‘testdebug’(target:bst-dev): .….….….….….….….….….…Success to start application.
ubuntu@admin:~$ pi app-debug testdebug –target bst-dev -------------
————---------
| Debug IP | Debug Port | State | -------------
————---------
| 23.22.37.20 | 52841 | RUNNING | -------------
————---------
ubuntu@admin:~$ pi status 1803 -------------
———--------
———–---------
————–------------
| Instance ID | Status | CPU(%) | Memory(M) | Disk(M) | RequestCount | ErrorCount | -------------
———--------
———–---------
————–------------
| 40c8f1 | running | 0.2 | 270 | 116 | 0 | 0 | | 353573 | running | 0.2 | 232 | 116 | 0 | 0 | -------------
———--------
———–---------
————–------------
ubuntu@admin:~$ pi scale-app 1817 How many instances? [1]: 2 Scaling application: .….….….….….….….……OK
ubuntu@admin:~$ pi update-app 1817 1: test Select Version: 1 Error: Don’t need update application!
ubuntu@admin:~$ pi upload 1: javagithub 2: javatest 3: javawj Select Project: 2 Selected Project: javatest Please enter the path of upload war file: /home/wangjing/paashelp.war Please enter the version: paashelp Please enter in the description: test Uploading “paashelp.war”: ..OK
ubuntu@admin:~$ pi update-app 1817 1: test 2: paashelp Select Version: 2 Updating application: .….….….….….….….….….….….OK
ubuntu@admin:~$ pi app-log 1817 Select instance index(from 0 to 1) [0]: 0 1: stderr.log 914B 2: stdout.log 0B Select logs, indexed list?: 1 Selected logs: stderr.log
Jul 20, 2012 7:25:52 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-39652 Jul 20, 2012 7:25:52 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1155 ms Jul 20, 2012 7:25:52 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Jul 20, 2012 7:25:52 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.32 Jul 20, 2012 7:25:52 AM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive probe.war Jul 20, 2012 7:25:57 AM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory ROOT Jul 20, 2012 7:25:57 AM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-39652 Jul 20, 2012 7:25:57 AM org.apache.catalina.startup.Catalina start INFO: Server startup in 5332 ms
ubuntu@admin:~$ pi create-env 1817 Environment Name: aa Environment Value: bb OK
ubuntu@admin:~$ pi app-env 1817 ------
——-+ | Name | Value | ------
——-+ | aa | bb | ------
——-+
ubuntu@admin:~$ pi delete-env 1817 1: aa Environment Name: 1 Selected Environment Name: aa OK
ubuntu@admin:~$ pi bind-service 1817 1: mysql_demo_251_cloudpi-dedicated-mysql_wangjing Select services, indexed list?: 1 Selected services: mysql_demo_251_cloudpi-dedicated-mysql_wangjing Binding service: .….….….….….….……OK
ubuntu@admin:~$ pi app-service 1817 -------------------------------------------------
———-----------
| Name | Version | Type | -------------------------------------------------
———-----------
| mysql_demo_251_cloudpi-dedicated-mysql_wangjing | 5.1.410 | dedicated | -------------------------------------------------
———-----------
ubuntu@admin:~$ pi unbind-service 1817
-
mysql_demo_251_cloudpi-dedicated-mysql_wangjing
Select Service: 1 Selected Service: mysql_demo_251_cloudpi-dedicated-mysql_wangjing Unbinding service: .….….….….….….….….….….….……OK
ubuntu@admin:~$ pi services -----
————————————————-------------
————–---------
———-+ | ID | Name | Farm Name | Service Type | Version | Owner | -----
————————————————-------------
————–---------
———-+ | 269 | mysql_demo_251_cloudpi-dedicated-mysql_wangjing | mysql_demo | mysql | 5.1.41 | wangjing | -----
————————————————-------------
————–---------
———-+
ubuntu@admin:~$ pi service 1: mysql_demo_251_cloudpi-dedicated-mysql_wangjing Select service: 1 href="{"username":"scalr","host":"ec2-75-101-185-90.compute-1.amazonaws.com","password":"03u5PVIFMjV8zg1WLudb","user":"scalr","hostname":"ec2-75-101-185-90.compute-1.amazonaws.com","type":"master","port":3306,"name":"cloudpidb"">version”:“5.1.41”,“vendor”:“mysql”,“plan”:“free”,“credentials”:,“url”:“mysql.com/”,“service_id”:“mysql_demo_251_cloudpi-dedicated-mysql_wangjing”}
ubuntu@admin:~$ pi check-service 1: mysql_demo_251_cloudpi-dedicated-mysql_wangjing Select service: 1 Service is available.
ubuntu@admin:~$ pi export-service 1: mysql_demo_251_cloudpi-dedicated-mysql_wangjing Select service: 1 api.staging.samsungcloud.org/dedicatedservice/6.7250000000000005
ubuntu@admin:~$ pi import-service Input the url to import: 127.0.0.1:8080/dedicatedservice/6.550000000000001 OK
ubuntu@admin:~$ pi register-service 1: mysql_demo_251_cloudpi-dedicated-mysql_wangjing 2: membase-session-manager1_230_cloudpi-dedicated-membase_dev Select service: 2 1: ap-ne-test 2: bst-dev Select target: 1 1: App Service 2: Session Service Select service type: 1 OK
ubuntu@admin:~$ pi deregister-service 1: mysql_demo_251_cloudpi-dedicated-mysql_wangjing 2: membase-session-manager1_230_cloudpi-dedicated-membase_dev Select service: 2 1: ap-ne-test Select target: 1 OK
ubuntu@admin:~$ pi delete-service 1: mysql_demo_251_cloudpi-dedicated-mysql_wangjing 2: membase-session-manager1_230_cloudpi-dedicated-membase_dev Select service: 2 OK
ubuntu@admin:~$ pi map-dns 1817 1: javatest1.samsungpaas.com 2: javatest2.samsungpaas.com Select dns, indexed list?: 1,2 Selected dns: javatest1.samsungpaas.com javatest2.samsungpaas.com Mapping dns: …OK
ubuntu@admin:~$ pi unmap-dns 1817 1: javatest1.samsungpaas.com 2: javatest2.samsungpaas.com Select DNS: 2 Selected DNS: javatest2.samsungpaas.com Unmapping dns: …OK
ubuntu@admin:~$ pi app-dns 1817 ---------------------------
| Mapped DNS Name | ---------------------------
| javatest1.samsungpaas.com | ---------------------------
ubuntu@admin:~$ pi dns -----
—————————--------------
————-+ | ID | DNS Name | Project Name | Description | -----
—————————--------------
————-+ | 203 | javawj.samsungpaas.com | javawj | | | 204 | javawj2.samsungpaas.com | javawj | | | 165 | rails.samsungpaas.com | railswj | | | 193 | railsdemo.samsungpaas.com | railswj | | | 168 | railstest.samsungpaas.com | railswj | | | 194 | railstmp.samsungpaas.com | railswj | | -----
—————————--------------
————-+
ubuntu@admin:~$ pi create-dns 1: railswj 2: javagithub 3: railsgithub 4: javawj 5: sinatra Project name: 4 1: samsungpaas.com Select dns zone: 1 DNS name: javawangj Description: test OK
ubuntu@admin:~$ pi register-dns 1: rails.samsungpaas.com 2: railstest.samsungpaas.com 3: railsdemo.samsungpaas.com 4: railstmp.samsungpaas.com 5: javawj.samsungpaas.com 6: javawj2.samsungpaas.com 7: javawangj.samsungpaas.com Select DNS: 7 1: ap-ne-test 2: bst-dev Select target: 1 1: Africa 2: Antarctica 3: Asia 4: Europe 5: North America 6: Oceania 7: South America Select continent: 3 Select continent: Asia 1: Afghanistan 2: Armenia 3: Asia(continent) 4: Asia/Pacific Region 5: Azerbaijan 6: Bahrain 7: Bangladesh 8: Bhutan 9: British Indian Ocean Territory 10: Brunei Darussalam 11: Cambodia 12: China 13: Christmas Island 14: Cocos (Keeling) Islands 15: Cyprus 16: Georgia 17: Hong Kong 18: India 19: Indonesia 20: Iran, Islamic Republic of 21: Iraq 22: Israel 23: Japan 24: Jordan 25: Kazakhstan 26: Kuwait 27: Kyrgyzstan 28: Lao People’s Democratic Republic 29: Lebanon 30: Macao 31: Malaysia 32: Maldives 33: Mongolia 34: Myanmar 35: Nepal 36: North Korea 37: Oman 38: Pakistan 39: Palestinian Territory 40: Philippines 41: Qatar 42: Saudi Arabia 43: Singapore 44: South Korea 45: Sri Lanka 46: Syrian Arab Republic 47: Taiwan 48: Tajikistan 49: Thailand 50: Timor-Leste 51: Turkmenistan 52: United Arab Emirates 53: Uzbekistan 54: Vietnam 55: Yemen Select country: 12 Select country: China OK
ubuntu@admin:~$ pi deregister-dns 1: rails.samsungpaas.com 2: railstest.samsungpaas.com 3: railsdemo.samsungpaas.com 4: railstmp.samsungpaas.com 5: javawj.samsungpaas.com 6: javawj2.samsungpaas.com 7: javawangj.samsungpaas.com Select DNS: 7 1: ap-ne-test 2: bst-dev Select target: 1 1: China Select record: 1 OK
ubuntu@admin:~$ pi delete-dns 1: rails.samsungpaas.com 2: railstest.samsungpaas.com 3: railsdemo.samsungpaas.com 4: railstmp.samsungpaas.com 5: javawj.samsungpaas.com 6: javawj2.samsungpaas.com 7: javawangj.samsungpaas.com Select DNS: 7 OK
ubuntu@admin:~$ pi project-events 1: javagithub 2: javatest 3: javawj 4: railsgithub 5: railswj 6: sinatra Select Project: 2 Selected Project: javatest ------------
———-----------------------
———–--------------------------------------------------------------------------------------------------
| Target | AppName | EventTime | EventInfo | EventDetail | ------------
———-----------------------
———–--------------------------------------------------------------------------------------------------
| | | 2012-08-04 08:15:06.0 | INFO | Success to create project : javatest | | ap-ne-test | java | 2012-08-04 08:18:32.0 | INFO | Success to create appliation. | | ap-ne-test | java | 2012-08-04 08:22:19.0 | INFO | Success to stop application. | | ap-ne-test | java | 2012-08-04 08:23:38.0 | INFO | Success to start application. | | ap-ne-test | java | 2012-08-04 08:28:40.0 | INFO | Success to scale instances to 2 | | ap-ne-test | java | 2012-08-04 08:32:59.0 | INFO | Success to upgrade application to : paashelp | | ap-ne-test | java | 2012-08-04 08:34:26.0 | ERROR | Fail to get log , the detail is :( Target: ap-ne-test.samsungcloud.org is not running! ) | | ap-ne-test | java | 2012-08-04 08:34:39.0 | ERROR | Fail to get log , the detail is :( Target: ap-ne-test.samsungcloud.org is not running! ) | | ap-ne-test | java | 2012-08-04 08:36:05.0 | INFO | Success to add env : aa=bb | | ap-ne-test | java | 2012-08-04 08:36:45.0 | INFO | Success to delete env. | | ap-ne-test | java | 2012-08-04 08:40:01.0 | INFO | Success to map url. | | ap-ne-test | java | 2012-08-04 08:40:10.0 | INFO | Success to unmap url. | ------------
———-----------------------
———–--------------------------------------------------------------------------------------------------
ubuntu@admin:~$ pi project-tags 1: javagithub 2: javatest 3: javawj 4: railsgithub 5: railswj 6: sinatra Select Project: 2 Selected Project: javatest
--------
| Tag | --------
| v0.0.0 | --------
ubuntu@admin:~$ pi project-commits 1: javagithub 2: javatest 3: javawj 4: railsgithub 5: railswj 6: sinatra Select Project: 2 Selected Project: javatest 1: v0.0.0 Select Tag: 1 Selected Tag: v0.0.0 ------------------------------------------
—————————--------------
| CommitId | Date | Comment | ------------------------------------------
—————————--------------
| e6ea3d82736f742ce2e4b1f36a27889ca8b150ac | 2012-08-04 08:14:13 +0000 | init project | ------------------------------------------
—————————--------------
ubuntu@admin:~$ pi delete-app 1: all 2: project 3: target Select application by: 2 Select application by project 1: javagithub 2: javatest 3: javawj 4: railsgithub 5: railswj 6: sinatra Select Project: 2 Selected Project: javatest 1: java Select Application: 1 Selected Application: java Deleting application: …OK
ubuntu@admin:~$ pi delete-project 1: javagithub 2: javatest 3: javawj 4: railsgithub 5: railswj 6: sinatra Select Project: 2 Selected Project: javatest Deleting project “javatest”: .….….…OK
ubuntu@admin:~$ pi logout Successfully logged out of [api.staging.samsungcloud.org]
-
Common Exception
ubuntu@admin:~$ pi login Attempting login to ‘api.staging.samsungcloud.org’? [Yn]: n Please input URL: test.org Host is not available or is not valid: ‘test.org’ Problem with login, Cannot access target (getaddrinfo: Name or service not known), try again.
ubuntu@admin:~$ pi github Please input your name: ruanzhimin Please input your email: [email protected] Please input your password: ***
Error (5001007): Invalid github account.
ubuntu@admin:~$ pi project-events 12345678
Error (4043004): The project is not belongs to current account.Project id : 12345678