Account
Create Account
(Custom Web Application)
In CloudStick, webapplications are named as 'Accounts', each account has it's own system user. To create an Account, first we need need to create a System User.
Once system user is created, we can proceed further with creating account.
Parameters
Variable | Necessity | Type | Description |
---|---|---|---|
sys_user | REQUIRED | string | system user name |
id | REQUIRED | string | system user ID |
password | REQUIRED | STRING | system user password |
REQUIRED | STRING | email id for communication | |
name | REQUIRED | STRING | web application name |
domains | REQUIRED | STRING | web application domain name |
php_version | REQUIRED | STRING | PHP version for this web application |
is_active | OPTIONAL | BOOLEAN | true or false |
stack_type | REQUIRED | STRING | nginx or apache/nginx web stack |
ubuntu_version | REQUIRED | STRING | Ubuntu version |
public_path | OPTIONAL | STRING | public_path, folder inside web root |
php_process_manager | REQUIRED | STRING | PHP process manager |
cj_protection | REQUIRED | BOOLEAN | Click Jack protection |
xss_protection | REQUIRED | BOOLEAN | Cross-site scripting Protection |
ms_protection | REQUIRED | BOOLEAN | Mime Sniffing Portection |
php_max_children | REQUIRED | STRING | PHP maximum children |
php_max_requests | REQUIRED | STRING | PHP maximum requests |
php_start_servers | REQUIRED | STRING | PHP start servers |
php_min_spare_servers | REQUIRED | STRING | PHP minimum spare servers |
php_max_spare_servers | REQUIRED | STRING | PHP maximum spare servers |
php_open_base_dir | REQUIRED | STRING | PHP openbase directory |
php_timezone | REQUIRED | STRING | PHP timezone |
php_disable_functions | REQUIRED | STRING | PHP disable functions |
php_max_execution_time | REQUIRED | STRING | PHP maximum execution time |
php_max_input_time | REQUIRED | STRING | PHP maximum input time |
php_max_input_vars | REQUIRED | STRING | PHP maximum input variables |
php_memory_limit | REQUIRED | STRING | PHP memory limit |
php_post_max_size | REQUIRED | STRING | PHP post maximum size |
php_upload_max_filesize | REQUIRED | STRING | PHP upload maximum file size |
php_session_max_lifetime | REQUIRED | STRING | PHP secssion maximum life time |
php_allow_url_fopen | REQUIRED | BOOLEAN | PHP allow URL fopen |
php_short_open_tag | REQUIRED | BOOLEAN | PHP short open tag |
HTTP REQUEST
POST https://api.cloudstick.io/api/v1/webstacks/servers/{server-id}/users/{user-id}?api_key={api-key}&secret_key={secret-key}
REQUEST
curl --request POST \
--url 'https://api.cloudstick.io/api/v1/webstacks/servers/{server-id}/users/{user-id}?api_key={api-key}&secret_key={secret-key}' \
--header 'Content-Type: application/json' \
--data '{
"sys_user": {
"id":{sysuser_id},
"password": "my_password"
},
"email": "user@domain.com",
"name": "app-test",
"domains": ["test.cloudstick.me"],
"php_version": "74",
"is_active": true,
"stack_type": "apache/nginx",
"ubuntu_version": "18.04",
"public_path": "public_html",
"php_process_manager": "dynamic",
"cj_protection":true,
"xss_protection":true,
"ms_protection":true,
"php_max_children":50,
"php_max_requests":500,
"php_start_servers":20,
"php_min_spare_servers":10,
"php_max_spare_servers":30,
"php_open_base_dir":"/home/user_name/apps/app-test/public_html/:/var/lib/php/session:/tmp",
"php_timezone":"UTC",
"php_disable_functions":"getmyuid,passthru,leak,listen,diskfreespace,tmpfile,link,ignore_user_abort,shell_exec,dl,set_time_limit,exec,system,highlight_file,source,show_source,fpassthru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_open,proc_close,proc_nice,proc_terminate,escapeshellcmd,ini_alter,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,symlink,posix_geteuid,ini_alter,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server",
"php_max_execution_time":30,
"php_max_input_time":60,
"php_max_input_vars":1000,
"php_memory_limit":256,
"php_post_max_size":256,
"php_upload_max_filesize":256,
"php_session_max_lifetime":1440,
"php_allow_url_fopen":true,
"php_short_open_tag":true
}'
RESPONCE
Type :- 201 Created
Body :-
{
"id": 1234,
"server_id": 123,
"server_uuid": "N123gxMTgtY45zg4Yi005ZTg2LWFhNTktYTZhYzk4NTAwMTJk",
"created_at": "2021-09-19T15:20:56.202712438Z",
"name": "app-test",
"domains": [
"test.cloudstick.me"
],
"php_version": "74",
"is_active": true,
"stack_type": "apache/nginx",
"public_path": "public_html",
"initial_public_path": "",
"email": "user@domain.com",
"is_node_js": false,
"nodejs_port": 0,
"webapp_type": "",
"cj_protection": true,
"xss_protection": true,
"ms_protection": true,
"php_process_manager": "dynamic",
"php_max_children": 50,
"php_max_requests": 500,
"php_start_servers": 20,
"php_min_spare_servers": 10,
"php_max_spare_servers": 30,
"php_open_base_dir": "/home/user_name/apps/app-test/public_html:/var/lib/php/session:/tmp",
"php_timezone": "UTC",
"php_disable_functions": "getmyuid,passthru,leak,listen,diskfreespace,tmpfile,link,ignore_user_abort,shell_exec,dl,set_time_limit,exec,system,highlight_file,source,show_source,fpassthru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_open,proc_close,proc_nice,proc_terminate,escapeshellcmd,ini_alter,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,symlink,posix_geteuid,ini_alter,socket_listen,socket_create_listen,socket_read,socket_create_pair,stream_socket_server",
"php_max_execution_time": 30,
"php_max_input_time": 60,
"php_max_input_vars": 1000,
"php_memory_limit": 256,
"php_post_max_size": 256,
"php_upload_max_filesize": 256,
"php_session_max_lifetime": 1440,
"php_allow_url_fopen": true,
"php_short_open_tag": true,
"add_php_open_base_dir": "",
"is_backup_enabled": false,
"sys_user": {
"id": 1234,
"created_at": "2021-09-19T15:19:00.728112Z",
"user_name": "user_name",
"email": "",
"password": "my_password",
"server_id": 123,
"is_sudo": {
"Bool": false,
"Valid": false
}
},
"nginx_cache": null
}
List Accounts
HTTP REQUEST
GET https://api.cloudstick.io/api/v1/webstacks/users/1234?api_key={API_KEY}&secret_key={SECRET_KEY}
REQUEST
curl --request GET \
--url 'https://api.cloudstick.io/api/v1/webstacks/users/1234?api_key={API_KEY}&secret_key={SECRET_KEY}'
RESPONCE
Type :- 200 OK
Body :-
[
{
"webstack_id": 1235,
"webstack_name": "app-test",
"user_name": "cloudstick user",
"sys_user_name": "user_name",
"server_name": "test_server",
"server_ip": "127.0.0.1",
"server_id": 123,
"server_uuid": "N123gxMTgtY45zg4Yi005ZTg2LWFhNTktYTZhYzk4NTAwMTJk",
"php_version": 74,
"stack_type": "apache/nginx",
"domain_name": "test.cloudstick.me"
},
]