To install `ucloud-cli` you need to execute the following commands. Make sure you have [Python 3.7](https://www.python.org/) and [pipenv](https://pypi.org/project/pipenv/) installed.
1. Clone `ucloud-cli` git repository. `ucloud-cli` is needed to talk with ucloud backend i.e create/delete/start/stop VM, attach network to VM etc.
1. Clone `ucloud-cli` git repository. `ucloud-cli` is needed to talk with ucloud backend i.e create/deleteTO_BE_/start/stop VM, attach network to VM etc.
@ -47,7 +47,84 @@ To install `ucloud-cli` you need to execute the following commands. Make sure yo
vm
```
## Examples
## Usage Examples
*If you are reading this it means that you are testing ucloud before its general public release. So, this document assume that you are both maintainer (person who install/manage ucloud installation) and enduser of ucloud.*
### Create Image From File
The first step after installation of ucloud is to create a base image on which VMs would base themself. To do this, perform the following steps
1. Upload a **.qcow2** OS image under /var/www/$username where $username would be your username.
2. Wait for few seconds so that your image/file get tracked by ucloud-file-scanner
3. Now, list all of your files. You can do this by executing `python ucloud.py user files --name $username --realm $realm --seed $seed`. A sample output is given below
```json
{
"message": [
{
"filename": "alpine.qcow2",
"uuid": "aa323e6a-2479-4554-b2b2-7a2eb1b9952f"
},
]
}
```
4. As, you can see we uploaded alpine.qcow2 image. You can upload any image as far as it is in qcow2 format.
5. Now, execute the following command to ask ucloud to create base image and make it publicly available for other as well.