@@ -8,23 +8,30 @@ import (
88var (
99 createCmd = & cobra.Command {
1010 Use : "create [command]" ,
11- Short : "creates new [service|application|domain|volume|worker|config ]" ,
11+ Short : "creates new [service|application|domain|volume]" ,
1212 Long : `` ,
1313 Run : func (cmd * cobra.Command , args []string ) {
14- if cmd .Flag ("compose-file" ).Changed {
15- //NOOP
16- // composeCreate(cmd, args)
17- } else {
18- cmd .Help ()
19- }
14+ cmd .Help ()
2015 }}
2116
2217 appCreateCmd = & cobra.Command {
2318 Use : "application" ,
19+ Run : appCreate ,
2420 Short : "creates a new application" ,
25- Long : `Creates a new application.
26- if no <name> is provided, one will be generated automatically.` ,
27- Run : appCreate }
21+ Long : `Creates a new application.` ,
22+ Example : `
23+ $: yb create application \
24+ --image="hub.yottab.io/test/dotnetcore:aspnetapp" \
25+ --name="myaspnetapp" \
26+ --port=80
27+
28+
29+ $: yb create application \
30+ --image="hub.yottab.io/test/myworker:v1.2.3" \
31+ --name="myaspnetapp" \
32+ --min-scale=4 \
33+ --port=8080 \
34+ --endpoint-type=private` }
2835
2936 srvCreateCmd = & cobra.Command {
3037 Use : "service [PRODUCT.name]" ,
3340 Long : `Creates a new servive.
3441 if no 'name' is provided, one will be generated automatically.` ,
3542 Example : `
36- $: yb product
43+ ## Get a list of Service Plan and Required Variables
44+ $: yb product service mysql
45+
3746 $: yb create service mysql \
38- --name=db \
47+ --name=mydb \
3948 --plan=starter \
4049 --variable="Database.password=DaRHEm@DaX" \
4150 --variable="Database.user=root"` }
@@ -51,24 +60,40 @@ var (
5160
5261 volumeCreateCmd = & cobra.Command {
5362 Use : "volume" ,
63+ Run : volumeCreate ,
5464 Short : "create new volume" ,
5565 Long : `create new volume` ,
56- Run : volumeCreate }
66+ Example : `
67+ ## Get a list of Volume Plans
68+ $: yb product volume
69+
70+ $: yb create volume \
71+ --name="my-volume" \
72+ --volume-type="persistant-2Gi"` }
5773
5874 bucketCreateCmd = & cobra.Command {
5975 Use : "bucket [name]" ,
76+ Run : bucketCreate ,
6077 Short : "create an Object Storage bucket over the YOTTAb" ,
61- Long : `create an Object Storage bucket over the YOTTAb` ,
62- Run : bucketCreate }
78+ Long : `create an Object Storage bucket over the YOTTAb` }
6379)
6480
6581// Update Command
6682var (
6783 updateCmd = & cobra.Command {
6884 Use : "update [APP.name]" ,
85+ Run : appUpdate ,
6986 Short : "update the config of existing application" ,
7087 Long : `This subcommand Update an existing application.` ,
71- Run : appUpdate }
88+ Example : `
89+ ## The Application Version is updated
90+ $: yb update myadmin \
91+ --image="hub.yottab.io/test/myadmin:v1.2.3"
92+
93+
94+ ## The Application Scale is updated
95+ $: yb update myadmin \
96+ --min-scale=4` }
7297)
7398
7499func init () {
@@ -103,9 +128,8 @@ func init() {
103128 // Application Update
104129 updateCmd .Flags ().Uint64VarP (& flagVarPort , "port" , "p" , 0 , "port of application" )
105130 updateCmd .Flags ().StringVarP (& flagVarImage , "image" , "i" , "" , "image of application" )
106- updateCmd .Flags ().Uint64VarP (& flagVarMinScale , "min-scale" , "m" , 1 , "min scale of application" )
107- updateCmd .Flags ().StringVarP (& flagVarEndpointType , "endpoint-type" , "e" , "http" , "Accepted values: http|grpc, default to http" )
108- updateCmd .Flags ().StringArrayVarP (& flagVariableArray , "routes" , "r" , nil , "Routes of application" )
131+ updateCmd .Flags ().Uint64VarP (& flagVarMinScale , "min-scale" , "m" , 0 , "min scale of application" )
132+ updateCmd .Flags ().StringVarP (& flagVarEndpointType , "endpoint-type" , "e" , "http" , "Accepted values: http|grpc|private" )
109133
110134 rootCmd .AddCommand (
111135 createCmd ,
0 commit comments