Admin commands
The admin commands are used to control and manage your self-hosted version of CwCloud.
Notes:
- Those commands are only for admin users (if you're using a self-hosted version for example)
- To checkout how to install and update the
cwc
cli checkout this tutorial - For the commands accessible for all users, checkout this tutorial (you should read-it first to handle authentication)
Translationsβ
This tutorial is also available in the following languages:
Usersβ
Listβ
cwc admin user ls
Get user by IDβ
cwc admin user ls -u <user_id>
cwc admin user ls --user <user_id>
Deleteβ
cwc admin user delete -u <user_id>
cwc admin user delete --user <user_id>
Projectsβ
Listβ
cwc admin project ls
Search Projectβ
Search Project By IDβ
cwc admin project ls -p <project_id>
cwc admin project ls --id <project_id>
Search Project By Nameβ
cwc admin project ls -n <project_name>
cwc admin project ls --name <project_name>
Search Project By URLβ
cwc admin project ls -u <project_url>
cwc admin project ls --url <project_url>
Createβ
cwc admin project create -n <project_name>
Notes:
- If you want to create a project in another Gitlab instance you can provide the Gitlab host, the group id, your access token and your git username by adding these options:
-h
or--host
: Gitlab instance host-t
or--token
: your Gitlab access token-g
or--git
: Your Git username-n
or--namespace
: namespace or group id where the project will be created-p
or--type
: Project type (vm or k8s)
Deleteβ
Delete Project By IDβ
cwc admin project delete -p <project_id>
cwc admin project delete --id <project_id>
Delete Project By Nameβ
cwc admin project delete -n <project_name>
cwc admin project delete --name <project_name>
Delete Project By URLβ
cwc admin project delete -u <project_url>
cwc admin project delete --url <project_url>
Environmentsβ
Add environmentβ
cwc admin environment create -n <name> -r <role1>,<role2> -m <main_role> -p <path> -d <description> -s <subdomain1>,<subdomain2>
cwc admin environment create --name <name> --roles <role1>,<role2> -main-role <main_role> --path <path> --description <description> --subdomains <subdomain1>,<subdomain2>
Note: if you want to mark the environment as private use the -a
or --private
flag.
List all environmentsβ
cwc admin environment ls
Get environment by IDβ
cwc admin environment ls -e <environment_id>
cwc admin environment ls --environment <environment_id>
Instancesβ
List instancesβ
cwc admin instance ls
Get instance by IDβ
cwc admin instance ls -i <instance_id>
cwc admin instance ls --instance <instance_id>
Createβ
cwc admin instance create -n <instance_name> -e <environement> -t <instance_type> -p <project_name> -z <zone> -m <user_mail>
cwc admin instance create -n <instance_name> -e <environement> -t <instance_type> -i <project_id> -z <zone> -m <user_mail>
cwc admin instance create -n <instance_name> -e <environement> -t <instance_type> -u <project_url> -z <zone> -m <user_mail>
Notes:
- use
nova
zone for ovh and1
or2
for scaleway instance_type
corresponds to the provider instance sizing (i.e:DEV1-M
for Scaleway)- use
--dns_zone
ou-d
to choose the dns zone in which the instance will be created (you can list availble instances by runningcwc dnszones ls
)
Update statusβ
cwc admin instance update -i <instance_id> -s <action>
cwc admin instance update --instance <instance_id> --status <action>
Note: status must be poweroff
, poweron
or reboot
Deleteβ
cwc admin instance delete -i <instance_id>
cwc admin instance delete --instance <instance_id>
Refresh stateβ
cwc admin instance refresh -i <instance_id>
cwc admin instance refresh --instance <instance_id>
Buckets / object storageβ
Add bucket to a userβ
cwc admin bucket create -n <bucket_name> -t <bucket_type> -u <user_mail>
cwc admin bucket create --name <bucket_name> --type <bucket_type> --user <user_mail>
List all bucketsβ
cwc admin bucket ls
Get bucket by IDβ
cwc admin bucket ls -b <bucket_id>
cwc admin bucket ls --bucket <bucket_id>
Renew credentialsβ
cwc admin bucket renew -b <bucket_id>
cwc admin bucket renew --bucket <bucket_id>
Transfer to another userβ
cwc bucket transfer -b <bucket_id> -e <receiver_email>
cwc bucket transfer --bucket <bucket_id> --email <receiver_email>
Deleteβ
cwc admin bucket delete -b <bucket_id>
cwc admin bucket delete --bucket <bucket_id>
OCI / Docker registriesβ
Add registry to a userβ
cwc admin registry create -n <registry_name> -t <registry_type> -u <user_mail>
cwc admin registry create --name <registry_name> --type <registry_type> --user <user_mail>
Listβ
cwc admin registry ls
Get Registry by IDβ
cwc admin registry ls -r <registry_id>
cwc admin registry ls --registry <registry_id>
renew credentialsβ
cwc admin registry renew -r <registry_id>
cwc admin registry renew --registry <registry_id>
Transfer to another userβ
cwc registry transfer -r <registry_id> -e <receiver_email>
cwc registry transfer --registry <registry_id> --email <receiver_email>
Deleteβ
cwc admin registry delete -r <registry_id>
cwc admin registry delete --registry <registry_id>
Emailsβ
Send emailβ
cwc admin email -f from@provider.com -t to@provider.com -s subject -c content -m false
cwc admin email --from from@provider.com --to to@provider.com --subject subject --content content --templated false
Faas functionβ
Listβ
cwc admin faas function ls
Get owner by function IDβ
cwc admin faas function ls -f <function_id>
cwc admin faas function ls --function <function_id>
Faas invocationβ
Listβ
cwc admin faas invocation ls
Get invoker by invocation IDβ
cwc admin faas invocation ls -i <invocation_id>
cwc admin faas invocation ls --invocation <invocation_id>
Faas Triggerβ
Listβ
cwc admin faas trigger ls
Get owner by trigger IDβ
cwc admin faas trigger ls -t <trigger_id>
cwc admin faas trigger ls --trigger <trigger_id>
Kubernetesβ
Environmentβ
List all environmentsβ
cwc admin kubernetes environment ls
Clusterβ
List all clustersβ
cwc admin kubernetes cluster ls
Delete cluster by Idβ
cwc admin kubernetes cluster delete -c <cluster_id>
## or
cwc admin kubernetes cluster delete --cluster <cluster_id>
Emailβ
Send an emailβ
You can send an email with the following command:
cwc email -t <recepient_email> -s <subject> -c <content>
Notes:
- There are other optional flags you can add:
-f
to add customized expeditor email address-b
to add a bcc email address-t
to use the comwork cloud template
Dns Recordsβ
List all the available DNS Recordsβ
You can list all the available DNS records according to the pre-configured provider:
cwc admin dnsRecord ls
Create a DNS recordβ
cwc admin dnsRecord create -n <record_name> -z <zone> -t <type> -l <ttl> -d <data>
## or
cwc admin dnsRecord create --name <record_name> --zone <zone> --type <type> -ttl <ttl> -d <data>
Delete a DNS recordβ
cwc admin dnsRecord delete -r <record_id> -n <record_name> -z <zone>
## or
cwc admin dnsRecord delete --record <record_id> --name <record_name> --zone <zone>