1
1
= Managing {astra_db} databases with {astra_cli}
2
2
3
- Use the following {astra_cli} commands to manage your {astra_db} databases.
3
+ Use the following {astra_cli} commands to manage your {astra_db} databases.
4
4
From the command line in a Terminal, the supported tasks are:
5
5
6
6
* <<List databases>>
@@ -19,7 +19,7 @@ From the command line in a Terminal, the supported tasks are:
19
19
20
20
== List databases
21
21
22
- To get the list of active databases in your {astra_db} organization, use the command `astra db list`.
22
+ To get the list of active databases in your {astra_db} organization, use the command `astra db list`.
23
23
24
24
[TIP]
25
25
====
@@ -90,7 +90,7 @@ Sample result::
90
90
test,7677a789-bd57-455d-ab2c-999999999999,eu-central-1,ACTIVE
91
91
demo,071d7059-d55b-4cdb-90c6-999999999999,us-east-1,ACTIVE
92
92
ac201,48c7178c-58cb-4657-b3d2-999999999999,us-east-1,ACTIVE
93
- ----
93
+ ----
94
94
--
95
95
====
96
96
@@ -147,7 +147,7 @@ Sample result::
147
147
"Name" : "ac201"
148
148
} ]
149
149
}
150
- ----
150
+ ----
151
151
--
152
152
====
153
153
@@ -257,7 +257,7 @@ Sample result::
257
257
| aws | us-east-2 | US East (Ohio) |
258
258
| aws | us-west-2 | US West (Oregon) |
259
259
+----------------+---------------------+-------------------------------+
260
- ----
260
+ ----
261
261
--
262
262
====
263
263
@@ -307,7 +307,7 @@ Sample result::
307
307
| aws | us-east-2 | US East (Ohio) |
308
308
| aws | us-west-2 | US West (Oregon) |
309
309
+----------------+---------------------+-------------------------------+
310
- ----
310
+ ----
311
311
--
312
312
====
313
313
@@ -350,7 +350,7 @@ Sample result::
350
350
+--------------------------------------+-----------------------------+---------------------+
351
351
| b665658a-ae6a-4f30-a740-999999999999 | [email protected] | active |
352
352
+--------------------------------------+-----------------------------+---------------------+
353
- ----
353
+ ----
354
354
--
355
355
====
356
356
@@ -379,7 +379,7 @@ Sample result::
379
379
| 825bd3d3-82ae-404b-9aad-999999999999 | [email protected] | invited |
380
380
| b665658a-ae6a-4f30-a740-999999999999 | [email protected] | active |
381
381
+--------------------------------------+-----------------------------+---------------------+
382
- ----
382
+ ----
383
383
--
384
384
====
385
385
@@ -408,7 +408,7 @@ astra role get "Database Administrator"
408
408
409
409
== Get database details
410
410
411
- To get general information or details on an entity, use the command `astra db get <db-name>`.
411
+ To get general information or details on an entity, use the command `astra db get <db-name>`.
412
412
The output includes specific information about the list of keyspaces available and the different regions.
413
413
414
414
[TIP]
@@ -455,7 +455,7 @@ Sample result::
455
455
| | |
456
456
| Regions | [0] us-east-1 |
457
457
+------------------------+-----------------------------------------+
458
- ----
458
+ ----
459
459
--
460
460
====
461
461
@@ -464,10 +464,10 @@ To get a special property, add the option `--key` and its type.
464
464
465
465
Multiple key types are available: `id`, `status`, `cloud`, `keyspace`, `keyspaces`, `region`, `regions`.
466
466
467
- Notice that the output is raw.
467
+ Notice that the output is raw.
468
468
469
- This command is expected to be used in scripts.
470
- Example:
469
+ This command is expected to be used in scripts.
470
+ Example:
471
471
472
472
[tabs]
473
473
====
@@ -486,11 +486,11 @@ Sample result::
486
486
[source,csv]
487
487
----
488
488
dde308f5-a8b0-474d-afd6-999999999999
489
- ----
489
+ ----
490
490
--
491
491
====
492
492
493
- To get the database status in a human readable result, use the `astra db status` command.
493
+ To get the database status in a human readable result, use the `astra db status` command.
494
494
Example:
495
495
496
496
[tabs]
@@ -510,14 +510,14 @@ Sample result::
510
510
[source,csv]
511
511
----
512
512
[ INFO ] - Database 'demo' has status 'ACTIVE'
513
- ----
513
+ ----
514
514
--
515
515
====
516
516
517
517
518
518
== Delete a database
519
519
520
- To delete an {astra_db} database, use the command `astra db delete <db-name>`.
520
+ To delete an {astra_db} database, use the command `astra db delete <db-name>`.
521
521
Example:
522
522
523
523
[source,bash]
@@ -550,7 +550,7 @@ astra help db list-keyspaces
550
550
=== Create a new keyspace
551
551
552
552
To add a keyspace named `ks2` to an existing database named `demo`, use the following command.
553
- The option `--if-not-exist` is optional but could help you provide idempotent scripts.
553
+ The option `--if-not-exist` is optional but could help you provide idempotent scripts.
554
554
Example:
555
555
556
556
[source,bash]
@@ -577,7 +577,7 @@ The purpose of {astra_cli} is to integrate with `cqlsh` and to perform the integ
577
577
578
578
=== Interactive mode
579
579
580
- If no options are provided, by default you'll enter `cqlsh` interactive mode.
580
+ If no options are provided, by default you'll enter `cqlsh` interactive mode.
581
581
Example:
582
582
583
583
[tabs]
@@ -602,14 +602,14 @@ Sample result::
602
602
Use HELP for help.
603
603
token@cqlsh>
604
604
605
- ----
605
+ ----
606
606
--
607
607
====
608
608
609
609
610
610
=== Execute CQL
611
611
612
- To execute a CQL statement with `cqlsh` use the flag `-e`.
612
+ To execute a CQL statement with `cqlsh` use the flag `-e`.
613
613
Example:
614
614
615
615
[source,bash]
@@ -620,7 +620,7 @@ astra db cqlsh demo -e "describe keyspaces;"
620
620
=== Execute CQL files
621
621
622
622
To execute CQL files with `cqlsh` use the flag `-f`.
623
- You could also use the CQL syntax SOURCE.
623
+ You could also use the CQL syntax SOURCE.
624
624
Example:
625
625
626
626
[source,bash]
@@ -667,7 +667,7 @@ astra db cqlsh demo -k demo
667
667
668
668
Create the table in cqlsh:
669
669
670
- [source,cqlsh ]
670
+ [source,cql ]
671
671
----
672
672
CREATE TABLE cities_by_country ( country_name text, name text, id int, state_id text, state_code text, state_name text, country_id text, country_code text, latitude double, longitude double, wikiDataId text, PRIMARY KEY ((country_name), name) );
673
673
@@ -719,14 +719,14 @@ Sample result::
719
719
148,266 | 0 | 8,361 | 663.86 | 767.56 | 817.89 | 30.91
720
720
Operation LOAD_20221123-182343-074618 completed successfully in 17 seconds.
721
721
Last processed positions can be found in positions.txt
722
- ----
722
+ ----
723
723
--
724
724
====
725
725
726
726
727
727
=== Count table row data
728
728
729
- Check than the data has been imported with cqlsh.
729
+ Check than the data has been imported with cqlsh.
730
730
Example:
731
731
732
732
[tabs]
@@ -769,7 +769,7 @@ country_name | name | country_code | country_id | id | latitude
769
769
Bangladesh | Bājitpur | BD | 19 | 8472 | 24.21623 | 90.95002 | 13 | 771 | Dhaka District | null
770
770
Bangladesh | Chandpur | BD | 19 | 8474 | 23.25 | 90.83333 | B | 803 | Chittagong Division | null
771
771
Bangladesh | Chapai Nababganj | BD | 19 | 8475 | 24.68333 | 88.25 | 54 | 813 | Rajshahi District | null
772
- ----
772
+ ----
773
773
--
774
774
====
775
775
@@ -799,14 +799,14 @@ Sample result::
799
799
Operation directory: /Users/awesome.user/Downloads/logs/COUNT_20221123-182833-197954
800
800
total | failed | rows/s | p50ms | p99ms | p999ms
801
801
134,574 | 0 | 43,307 | 315.71 | 457.18 | 457.18
802
- ----
802
+ ----
803
803
--
804
804
====
805
805
806
806
807
807
=== Unload data
808
808
809
- You can also unload data.
809
+ You can also unload data.
810
810
Example:
811
811
812
812
[tabs]
@@ -832,7 +832,7 @@ Sample result::
832
832
total | failed | rows/s | p50ms | p99ms | p999ms
833
833
134,574 | 0 | 14,103 | 927.51 | 1,853.88 | 1,853.88
834
834
Operation UNLOAD_20221123-183054-208353 completed successfully in 9 seconds.
835
- ----
835
+ ----
836
836
--
837
837
====
838
838
@@ -845,9 +845,9 @@ Use the `astra db download-scb` command to download the different secure connect
845
845
846
846
[source,bash]
847
847
----
848
- mkdir db-demo
849
- cd db-demo
850
- astra db download-scb demo
848
+ mkdir db-demo
849
+ cd db-demo
850
+ astra db download-scb demo
851
851
ls
852
852
----
853
853
@@ -874,7 +874,7 @@ astra db download-scb demo -f /tmp/demo.zip
874
874
875
875
When working with Astra DB, it's handy to generate a set of relevant environment variables such as database name, database region, API call URLs, and so on.
876
876
877
- This {astra_cli} command creates an `.env` file based on your environment.
877
+ This {astra_cli} command creates an `.env` file based on your environment.
878
878
Example:
879
879
880
880
[tabs]
@@ -908,19 +908,19 @@ Sample result::
908
908
ASTRA_ORG_ID="f9460f14-9879-...."
909
909
ASTRA_ORG_NAME="awe..."
910
910
ASTRA_ORG_TOKEN="AstraCS:QeUmROPLeNbd..."
911
- ----
911
+ ----
912
912
--
913
913
====
914
914
915
915
916
916
== Resume a hibernated database
917
917
918
- If you are using the {astra_db} Free plan, your database will be hibernated (made inactive) after 23 hours of inactivity.
918
+ If you are using the {astra_db} Free plan, your database will be hibernated (made inactive) after 23 hours of inactivity.
919
919
(This behavior does not occur when you upgrade to a paid {astra_db} plan.)
920
920
921
921
To wake up the database, you can use the `astra db resume` command.
922
922
923
- Assume you have a hibernating database.
923
+ Assume you have a hibernating database.
924
924
Example:
925
925
926
926
[tabs]
@@ -944,7 +944,7 @@ Sample result::
944
944
+---------------------+--------------------------------------+---------------------+----------------+
945
945
| mydatabase | 643c6bb8-2336-4649-97d5-999999999999 | eu-central-1 | HIBERNATED |
946
946
+---------------------+--------------------------------------+---------------------+----------------+
947
- ----
947
+ ----
948
948
--
949
949
====
950
950
@@ -971,7 +971,7 @@ Sample result::
971
971
+---------------------+--------------------------------------+---------------------+----------------+
972
972
| mydatabase | 643c6bb8-2336-4649-97d5-999999999999 | eu-central-1 | RESUMING |
973
973
+---------------------+--------------------------------------+---------------------+----------------+
974
- ----
974
+ ----
975
975
976
976
After some time:
977
977
@@ -982,7 +982,7 @@ After some time:
982
982
+---------------------+--------------------------------------+---------------------+----------------+
983
983
| mydatabase | 643c6bb8-2336-4649-97d5-999999999999 | eu-central-1 | ACTIVE |
984
984
+---------------------+--------------------------------------+---------------------+----------------+
985
- ----
985
+ ----
986
986
--
987
987
====
988
988
@@ -1011,7 +1011,7 @@ astra config create dev --token <token_of_org_2>
1011
1011
1012
1012
=== Use your section configuration
1013
1013
1014
- You can use an organization configuration anytime by qualifying the `astra` command with the `--config <config_name>` option.
1014
+ You can use an organization configuration anytime by qualifying the `astra` command with the `--config <config_name>` option.
1015
1015
Example:
1016
1016
1017
1017
[source,bash]
0 commit comments