Shell wrapper for the runcloud.io API https://runcloud.io/
Curl
jq (version 1.5 or later)
Run installation command and follow the instructions:
git clone https://github.com/RunCloud-cdk/shell-api-wrapper.git rcdk && cd rcdk && chmod +x install.sh && ./install.sh
After the installation will be created a config directory named rcdkConfigs
in the $HOME/rcdk
directory.
Now you can run rcdk ping
to test the API connection.
The Runcloud API requires you to pass the server_id
on each request (in addition to the ping
command and some of the servers
commands).
Therefore it was decided that before you start working with the API it is better to initialize work with a specific server.
Run rcdk init
. The program will show the first page of server list and offer to choose one of them by entering server id
.
To show any page watch List of all your servers .
This function supporting only Ubuntu/Debian users with bash interpreter.
See GNU documentation for more info about bash completion.
After the server has been selected, you can start working with most of the features from the API:
rcdk sysusers create $name $password
parameter
Description
Required
name
Name of the system user.
yes
password
Password for the system user. If leave blank this field then password will be generated automaticly.
no
Delete exists system user
rcdk sysusers delete $name $id
parameter
Description
Required
name
Name of the system user.
yes
id
ID of the system user.
yes
Get list of all system users
rcdk sysusers list $string || rcdk sysusers list $number
parameter
Description
Required
string
Search string for the list.
yes
number
The page number of the list.
yes
Change passwd for a system user
rcdk sysusers passwd $id $password
parameter
Description
Required
id
ID of the system user.
yes
password
Password for the system user. If leave blank this field then password will be generated automaticly.
no
Add new server to Runcloud
rcdk servers add $name $ip $provider
parameter
Description
Required
name
Server name.
yes
ip
IP address of the new server.
yes
provider
Hoster of the new server.
no
Delete exists server from Runcloud
parameter
Description
Required
id
ID of the server.
yes
Show server hardware info
rcdk servers list $string || rcdk servers list $number
parameter
Description
Required
string
Search string for the list.
yes
number
The page number of the list.
yes
List of all services installed on a selected server
rcdk services $action $name
parameter
Description
Required
action
A command for a service like start
, stop
, restart
or reload
.
yes
name
The name of service, one of: nginx-rc
, apache2-rc
, mysql
, supervisord
, redis-server
, memcached
, beanstalkd
.
yes
Create a new web application
This command asks you for all the arguments.
Delete exists web application
rcdk apps delete $name $id
parameter
Description
Required
name
Name of the web application.
yes
id
ID of the web application.
yes
View one page of web application list
rcdk apps list $string || rcdk apps list $number
parameter
Description
Required
string
Search string for the list.
yes
number
The page number of the list.
yes
rcdk dbs create $name $collation
parameter
Description
Required
name
Name of the database.
yes
collation
Collation of the database.
no
rcdk dbs delete $name $id
parameter
Description
Required
name
Name of the database.
yes
id
ID of the database.
no
View one page of databases list
rcdk dbs list $string || rcdk dbs list $number
parameter
Description
Required
string
Search string for the list.
yes
number
The page number of the list.
yes
Create a new database user
rcdk dbusers create $name $pass
parameter
Description
Required
name
Name of the database user.
yes
pass
Password for the database user. If leave blank this field then password will be generated automaticly.
no
Delete exists database user
rcdk dbusers delete $name $id
parameter
Description
Required
name
Name of the database user.
yes
id
ID of the database user.
yes
view one page of database users list
rcdk dbusers list $string || rcdk dbusers list $number
parameter
Description
Required
string
Search string for the list.
yes
number
The page number of the list.
yes
Attach database user to database
rcdk dbusers attach $name $id
parameter
Description
Required
name
Name of the database user.
yes
id
ID of the database.
yes
Revoke database user from database
rcdk dbusers revoke $name $id
parameter
Description
Required
name
Name of the database user.
yes
id
ID of the database.
yes
Change password for the database user
rcdk dbusers passwd $id $pass
parameter
Description
Required
id
ID of the database user.
yes
pass
Password for the database user. If leave blank this field then password will be generated automaticly.
no
Show list of domains for the web application
parameter
Description
Required
id
ID of the web application.
yes
Add new domain names for the web application
rcdk dns add $id $name_1 $name_n
parameter
Description
Required
id
ID of the web application.
yes
name
New domain name for the application.
yes
Delete domain name from the web application by id
rcdk dns delete $app_id $domain_id
parameter
Description
Required
app_id
ID of the web application.
yes
domain_id
ID of the domain name.
yes
Show info about SSL sertificate
parameter
Description
Required
id
ID of the web application.
yes
On SSL for the web application
parameter
Description
Required
id
ID of the web application.
yes
Update SSL for the web application
rcdk ssl update $app_id $ssl_id
parameter
Description
Required
app_id
ID of the web application.
yes
ssl_id
ID of the ssl sertficate for the web application.
yes
Off SSL for the web application
rcdk ssl off $app_id $ssl_id
parameter
Description
Required
app_id
ID of the web application.
yes
ssl_id
ID of the ssl sertficate for the web application.
yes
Add SSH public key to the system user of selected server
rcdk ssh add $label $name $pub_key
parameter
Description
Required
label
Label of this key in the web interface.
yes
name
The name of the system user to which the public key will bound.
yes
pub_key
Public key. WARNING: The key must be written in apostrophes!.
yes
Delete exists public key by id
rcdk ssh delete $label $key_id
parameter
Description
Required
label
Label of this key in the web interface.
yes
key_id
ID of the ssh key.
yes
Show list of all pubic keys of the selected server
rcdk ssh list $string || rcdk ssh list $number
parameter
Description
Required
string
Search string for the list.
yes
number
The page number of the list.
yes
Add or delete keys in store