File tree Expand file tree Collapse file tree 5 files changed +45
-17
lines changed
astra-shell/src/main/java/com/datastax/astra/shell Expand file tree Collapse file tree 5 files changed +45
-17
lines changed Original file line number Diff line number Diff line change 8
8
import com .datastax .astra .shell .cmd .db .DbCreateShell ;
9
9
import com .datastax .astra .shell .cmd .db .DbDeleteShell ;
10
10
import com .datastax .astra .shell .cmd .db .DbGetShell ;
11
+ import com .datastax .astra .shell .cmd .db .DbInfoShell ;
11
12
import com .datastax .astra .shell .cmd .db .DbListShell ;
12
13
import com .datastax .astra .shell .cmd .db .DbUseShell ;
13
14
import com .datastax .astra .shell .cmd .db .OperationsDb ;
43
44
44
45
// With selected db
45
46
DbCreateKeyspaceShell .class ,
46
- DbGetShell .class ,
47
+ DbInfoShell .class ,
47
48
DbCqlShellShell .class ,
48
49
QuitCommand .class ,
49
50
},
50
51
groups = {
51
52
@ Group (name = OperationsDb .DB , description = "Commands acting of database" , commands = {
52
- DbCreateShell .class ,
53
- DbDeleteShell .class ,
53
+ DbCreateShell .class ,
54
+ DbDeleteShell .class ,
54
55
DbListShell .class ,
55
- DbGetShell .class ,
56
-
57
- DbUseShell .class ,
56
+ DbGetShell .class ,
57
+ DbInfoShell . class ,
58
+ DbUseShell .class
58
59
}),
59
60
@ Group (name = OperationsDb .CMD_KEYSPACE , description = "Manage keyspaces (db must be selected)" , commands = {
60
61
DbCreateKeyspaceShell .class ,
64
65
RoleGetCli .class
65
66
}),
66
67
@ Group (name = OperationIam .COMMAND_USER , description = "Manage users permission" , commands = {
67
- UserListShell .class ,
68
- UserGetShell .class ,
69
- UserInviteShell .class ,
68
+ UserListShell .class ,
69
+ UserGetShell .class ,
70
+ UserInviteShell .class ,
70
71
UserDeleteShell .class
71
72
})
72
73
})
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public void run() {
70
70
}
71
71
}
72
72
ShellPrinter .println ("\n [What's NEXT ?]" , Ansi .Color .CYAN );
73
- System .out .println ("You are all set. You can now:" );
73
+ System .out .println ("You are all set.(configuration is stored in ~/.astrarc) You can now:" );
74
74
System .out .println (" • Use any command, 'astra help' will get you the list" );
75
75
System .out .println (" • Try with 'astra db list'" );
76
76
System .out .println (" • Enter interactive mode using 'astra'" );
Original file line number Diff line number Diff line change 1
1
package com .datastax .astra .shell .cmd .db ;
2
2
3
3
import com .datastax .astra .shell .ExitCode ;
4
- import com .datastax .astra .shell .ShellContext ;
4
+ import com .datastax .astra .shell .cmd . BaseCommand ;
5
5
import com .datastax .astra .shell .cmd .BaseShellCommand ;
6
+ import com .github .rvesse .airline .annotations .Arguments ;
6
7
import com .github .rvesse .airline .annotations .Command ;
8
+ import com .github .rvesse .airline .annotations .restrictions .Required ;
7
9
8
10
/**
9
11
* Display information relative to a db.
10
12
*
11
13
* @author Cedrick LUNVEN (@clunven)
12
14
*/
13
- @ Command (name = "info" , description = "Show details of a database (db must be selected) " )
15
+ @ Command (name = BaseCommand . GET , description = "Show details of a database" )
14
16
public class DbGetShell extends BaseShellCommand {
15
17
18
+ /** name of the DB. */
19
+ @ Required
20
+ @ Arguments (title = "DB" , description = "Database name or identifier" )
21
+ public String database ;
22
+
16
23
/** {@inheritDoc} */
17
24
public ExitCode execute () {
18
- if (!dbSelected ()) {
19
- return ExitCode .CONFLICT ;
20
- }
21
- return OperationsDb .showDb (ShellContext .getInstance ().getDatabase ().getId ());
25
+ return OperationsDb .showDb (database );
22
26
}
23
27
24
28
}
Original file line number Diff line number Diff line change
1
+ package com .datastax .astra .shell .cmd .db ;
2
+
3
+ import com .datastax .astra .shell .ExitCode ;
4
+ import com .datastax .astra .shell .ShellContext ;
5
+ import com .datastax .astra .shell .cmd .BaseShellCommand ;
6
+ import com .github .rvesse .airline .annotations .Command ;
7
+
8
+ /**
9
+ * Display information relative to a db.
10
+ *
11
+ * @author Cedrick LUNVEN (@clunven)
12
+ */
13
+ @ Command (name = "info" , description = "Show details of a database (db must be selected)" )
14
+ public class DbInfoShell extends BaseShellCommand {
15
+
16
+ /** {@inheritDoc} */
17
+ public ExitCode execute () {
18
+ if (!dbSelected ()) {
19
+ return ExitCode .CONFLICT ;
20
+ }
21
+ return OperationsDb .showDb (ShellContext .getInstance ().getDatabase ().getId ());
22
+ }
23
+
24
+ }
Original file line number Diff line number Diff line change 4
4
5
5
import com .datastax .astra .sdk .config .AstraClientConfig ;
6
6
import com .datastax .astra .shell .ExitCode ;
7
- import com .datastax .astra .shell .ShellContext ;
8
7
import com .datastax .astra .shell .cmd .BaseShellCommand ;
9
8
import com .datastax .astra .shell .out .LoggerShell ;
10
9
import com .github .rvesse .airline .annotations .Arguments ;
You can’t perform that action at this time.
0 commit comments