api icon indicating copy to clipboard operation
api copied to clipboard

Create Host from CLI throws error which is not proper

Open kumarashit opened this issue 4 years ago • 1 comments

Issue/Feature Description: Create Host using osdsctl with wrong parameter value. This throws error releated to JSON format. Now this error is not very intuitive for user to understand Why this issue to fixed / feature is needed(give scenarios or use cases): For better error response. How to reproduce, in case of a bug: Using CLI try to create Host

--osType Linux
ERROR: Request body has an error: doesn't match the schema: Error at "/osType":JSON value is not one of the allowed values
root@aks-VirtualBox:~/gopath/src/github.com/sodafoundation/installer/ansible# osdsctl host create ash-host1 --ip 127.0.0.1 --availabilityZones default --accessMode RW --osType linux
ERROR: Request body has an error: doesn't match the schema: Error at "/accessMode":JSON value is not one of the allowed values
root@aks-VirtualBox:~/gopath/src/github.com/sodafoundation/installer/ansible# osdsctl host create ash-host1 --ip 127.0.0.1 --availabilityZones default --accessMode rw --osType linux
ERROR: Request body has an error: doesn't match the schema: Error at "/accessMode":JSON value is not one of the allowed values

Other Notes / Environment Information: (Please give the env information, log link or any useful information for this issue) Correct format is:

root@aks-VirtualBox:~/gopath/src/github.com/sodafoundation/installer/ansible# osdsctl host create ash-host1 --ip 127.0.0.1 --availabilityZones default --osType linux+-------------------+--------------------------------------+
| Property          | Value                                |
+-------------------+--------------------------------------+
| Id                | 88f9823e-32ac-4aec-a660-8a56e2f16cb4 |
| CreatedAt         | 2020-06-13T19:49:44                  |
| UpdatedAt         |                                      |
| HostName          | ash-host1                            |
| OsType            | linux                                |
| AccessMode        | agentless                            |
| IP                | 127.0.0.1                            |
| Port              | 0                                    |
| Username          |                                      |
| AvailabilityZones | [default]                            |
| Initiators        | null                                 |
|                   |                                      |
+-------------------+--------------------------------------+
root@aks-VirtualBox:~/gopath/src/github.com/sodafoundation/installer/ansible#

kumarashit avatar Jun 13 '20 19:06 kumarashit

@PravinRanjan10 plz check it

PravinRanjan10 avatar Jun 22 '20 04:06 PravinRanjan10