|
4 | 4 |
|
5 | 5 | ## Overview
|
6 | 6 |
|
7 |
| -Astra Shell is a standalone command line interface. |
| 7 | +_This component is in heavy development that can lead to breaking changes_ |
8 | 8 |
|
9 |
| -- (1). It can be used as a stateless cli providing all options in the command line for automation purposes. |
| 9 | +## Installation |
10 | 10 |
|
11 |
| -``` |
12 |
| -astra create db |
13 |
| - --token AstraCS:...... \ |
14 |
| - --name workshop \ |
15 |
| - --region eu-central-1 \ |
16 |
| - --keyspace nosql1 |
17 |
| -``` |
| 11 | +Installing ASTRA-CLI on UNIX-like platforms is as easy as ever. ASTRA-CLI installs smoothly on macOS, Linux, WSL, Cygwin, Solaris and FreeBSD. We also support Bash and ZSH shells. |
18 | 12 |
|
19 |
| -- (2). It provides a configuration file to avoid users to enter credentials (tokens) each time. |
| 13 | +- Open a new terminal and enter: |
20 | 14 |
|
21 | 15 | ```
|
22 |
| -astra create db |
23 |
| - --config my_env_dev \ |
24 |
| - --name workshop \ |
25 |
| - --region eu-central-1 \ |
26 |
| - --keyspace nosql1 |
27 |
| -``` |
28 |
| - |
29 |
| -- (3). It provides a shell, an interactive repl with users interactions. |
30 |
| - |
31 |
| -``` |
32 |
| -astra --config my_env_dev |
33 |
| -
|
34 |
| -$myAstraOrganization>create db --name workshop --region eu-central-1 --keyspace nosql1 |
| 16 | +curl -Ls curl -s "https://dtsx.io/get-astra-cli" | bash |
35 | 17 | ```
|
36 | 18 |
|
37 |
| -## Prequisites |
| 19 | +- Follow the instructions on-screen to complete installation. Next, open a new terminal or enter: |
38 | 20 |
|
39 |
| -- A JRE/JDK 8+ installed is required. |
| 21 | +$ source "$HOME/.astra/install/astra-init.sh" |
40 | 22 |
|
41 |
| -## Installations |
42 |
| - |
43 |
| -- Download and extract the zip archive |
| 23 | +- Lastly, run the following code snippet to ensure that installation succeeded: |
44 | 24 |
|
45 | 25 | ```
|
46 |
| -unzip astra-shell-alpha1.zip |
| 26 | +astra -v |
47 | 27 | ```
|
48 | 28 |
|
49 |
| -- Initialization |
| 29 | +If all went well, the version should be displayed. Something like: |
50 | 30 |
|
51 | 31 | ```
|
52 |
| -cd astra-shell |
53 |
| -chmod 700 astra |
54 |
| -source auto-completions.bash |
| 32 | +0.3.2-SNAPSHOT |
55 | 33 | ```
|
56 | 34 |
|
57 |
| -- Configuration |
58 |
| - |
| 35 | +## Setup |
59 | 36 |
|
60 |
| -You are already set and can start typing commands |
61 |
| - |
62 |
| -``` |
63 |
| -astra show dbs -t <TOKEN> |
64 |
| -``` |
65 |
| - |
66 |
| -But it is annoying each time having to provide a token. What if you could save it ? |
| 37 | +- Run the following command and provide your token when needed |
67 | 38 |
|
68 | 39 | ```
|
69 | 40 | astra setup
|
70 | 41 | ```
|
71 | 42 |
|
72 |
| -- You can now |
73 |
| - |
74 |
| -``` |
75 |
| -astra show dbs |
76 |
| -``` |
77 |
| - |
78 |
| -## Configuration file |
79 |
| - |
80 |
| -- List available configurations |
| 43 | +- You should be good to go |
81 | 44 |
|
82 | 45 | ```
|
83 |
| -astra show configs |
84 | 46 | astra config list
|
85 | 47 | ```
|
86 | 48 |
|
87 |
| -- Create a new configuration providing a name |
88 |
| - |
89 |
| -``` |
90 |
| -astra config create dev -t <TOKEN> |
91 |
| -astra config list |
| 49 | +>``` |
| 50 | ++-----------------------------------------+ |
| 51 | +| configuration | |
| 52 | ++-----------------------------------------+ |
| 53 | + |
| 54 | +| DatastaxDevs | |
| 55 | + |
| 56 | ++-----------------------------------------+ |
92 | 57 | ```
|
93 | 58 |
|
94 |
| -- Show details of a dev |
| 59 | +- And access Astra |
95 | 60 |
|
96 | 61 | ```
|
97 |
| -astra config show dev |
| 62 | +astra db list |
98 | 63 | ```
|
99 | 64 |
|
100 |
| -- Set a configuration as default |
101 |
| - |
102 |
| -``` |
103 |
| -astra config default my_new_section |
| 65 | +>``` |
| 66 | ++---------------------+--------------------------------------+---------------------+----------------+ |
| 67 | +| name | id | default-region | status | |
| 68 | ++---------------------+--------------------------------------+---------------------+----------------+ |
| 69 | +| mtg | dde308f5-a8b0-474d-afd6-81e5689e3e25 | eu-central-1 | ACTIVE | |
| 70 | +| workshops | 3ed83de7-d97f-4fb6-bf9f-82e9f7eafa23 | eu-west-1 | ACTIVE | |
| 71 | +| sdk_tests | 06a9675a-ca62-4cd0-9b94-aefaf395922b | us-east-1 | ACTIVE | |
| 72 | +| api_days_dubai_2022 | 53f07b2a-8856-4741-b595-72b03be56bc6 | us-east1 | ACTIVE | |
| 73 | +| free_db | 8642763c-8ba7-4ede-a031-82355c7c34a7 | us-east1 | ACTIVE | |
| 74 | ++---------------------+--------------------------------------+---------------------+----------------+ |
104 | 75 | ```
|
105 | 76 |
|
106 |
| -- Rename on organization |
107 | 77 |
|
108 |
| -``` |
109 |
| -astra config rename my_new_section --name section2 |
110 |
| -``` |
111 | 78 |
|
112 |
| -- Delete a configuration |
113 |
| - |
114 |
| -``` |
115 |
| -astra config delete dev |
116 |
| -astra config list |
117 |
| -``` |
118 |
| - |
119 |
| -## Let's start the SHOW |
120 |
| - |
121 |
| -``` |
122 |
| -astra show dbs |
123 |
| -``` |
124 |
| - |
125 |
| -``` |
126 |
| -astra show roles |
127 |
| -``` |
128 |
| - |
129 |
| -``` |
130 |
| -astra show role <ROLE> |
131 |
| -``` |
132 |
| - |
133 |
| -``` |
134 |
| -astra show users |
135 |
| -``` |
136 |
| - |
137 |
| -``` |
138 |
| -astra show user <USER> |
139 |
| -``` |
140 |
| - |
141 |
| -## Shell we started now ? |
142 |
| - |
143 |
| - |
144 |
| -``` |
145 |
| -astra shell |
146 |
| -``` |
147 |
| - |
148 |
| - |
149 |
| -## Configuration |
150 |
| - |
151 |
| -``` |
152 |
| -show config <CONFIG> |
153 |
| -config load --name <CONFIG> |
154 |
| -config save --name <CONFIG> |
155 |
| -config setdefault --name <XXX> |
156 |
| -``` |
157 | 79 |
|
0 commit comments