Coder Social home page Coder Social logo

datastax / astra-cli Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 8.0 157.03 MB

Command Line Interface for DataStax Astra

Home Page: https://awesome-astra.github.io/docs/pages/astra/astra-cli/

License: Apache License 2.0

Java 99.51% Shell 0.43% Dockerfile 0.06%
astra astradb cli datastax-astra

astra-cli's Introduction

Astra CLI

License Apache2 Latest Release

Security Rating Reliability Rating Maintainability Rating Vulnerabilities Bugs

Coverage Lines of Code downloads

Astra CLI provides a command line interface in a terminal to operate DataStax Astra. The goal is to offer access to any feature without accessing the user interface.

The component was made generally available in 2022. See this blog for more details or refer to the Releases section.

Getting started

The extensive documentation will be provided in Awesome Astra

QuickStart

  • Install the CLI with
curl -Ls "https://dtsx.io/get-astra-cli" | bash
  • Open a new terminal to enable the autocompletion and add Astra in the path.

  • Enter your token

astra setup
  • You are good to go
astra db list

astra-cli's People

Contributors

clun avatar dependabot[bot] avatar msmygit avatar nicoloboschi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

astra-cli's Issues

[Feature] - Clone an Astra Database

  • Clone a keyspace (In same organization)
astra migration copy-keyspace
    --source-database mydb \
    --source-keyspace ks1 \
    --destination-database mydb2 \
    --destination-keyspace ks1
  • Clone a DB (In same organization)
astra migration copy-db \
   --from-database db1 \
   --to-database db2

cli fails to run on linux when installed through homebrew

Describe the bug

cli fails to run on linux when installed through homebrew

To Reproduce

Steps to reproduce the behavior:

  1. brew install datastax/astra-cli/astra-cli
  2. astra setup
  3. Shows error: exec format error: astra

Desktop (please complete the following information):

  • OS: [e.g. Linux]
  • Version [e.g. Ubuntu 20.04]

[BUG] `streaming get <tenant>` return ERROR You provided unknown or not well formatted argument.

Astra CLI command "stra streaming get <tenant> returns errors.

Installed Astra CLI version 0.2 on Windows 11 WSL2 terminal (Ubuntu 20.04 LTS)

After setup and adding my token, "astra streaming list" works fine. "astra streaming get " returns errors.

prompt@DESKTOP:~$ astra streaming get aws-useast1
[ERROR] You provided unknown or not well formatted argument.
[ERROR] Found unexpected parameters: [aws-useast1] (ParseArgumentsUnexpectedException)
[ERROR] Try 'astra help <your_command>' to get help**_

Desktop (please complete the following information):
Windows 11 WSL2 terminal (Ubuntu 20.04 LTS)

[BUG] astra db create-dotenv does not create .env file

Describe the bug

On my Macintosh, astra db create-dotenv workshops -k gotest does not create a .env file in my directory.

Weirdly, it works correctly on GitHub.

To Reproduce

Steps to reproduce the behavior:

astra db create-dotenv workshops -k gotest --- no .env
astra db create-dotenv workshops -k gotest --directory pwd`` --- works

Expected behavior
I expect the .env file to be created

Desktop (please complete the following information):

  • OS: OSX Catalina
  • Additional context
    Add any other context about the problem here.

When 2 databases has the same name, the error message should be more explicit

Is your feature request related to a problem? Please describe.
The CLI expects the db name to be unique. It is the condition to use the CLI smoothly without having to provide ids. If you issue a command and 2 DB exist with same name, the error message is not explicit.

Describe the solution you'd like
The error message should invite the use to avoid using same names AND ask them to use the identifier

[BUG] Quoting token causes additional char

Describe the bug

An additional '~' char was added to token when attempting setup

To Reproduce

Created the token as a session var (notice the quotes)
ASTRA_ORG_TOKEN="AstraCS:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Then tried setup (also quoted)
astra setup --token "${ASTRA_ORG_TOKEN}"

Got this

[WARN]  Invalid token: It must be start with 'AstraCS:..' and have Organization Administrator privileges.
[WARN]  Generated token at database creation cannot be used.
[WARN]  Please enter a valid token or quit with CTRL+C.
[ERROR] CONFIGURATION: Token 'AstraCS:AAAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa~' is invalid: Error in HTTP Request: Error Code=403, (HTTP_FORBIDDEN) Invalid permissions, check your token: {"errors":[{"ID":340017,"message":"Resource, token, was malformed. Error: auth-manager returned 403 for call %s/v2/admin/tokens"}]}

Expected behavior

If I remove the quotes astra setup --token ${ASTRA_ORG_TOKEN} the statement works as expected.

Desktop (please complete the following information):

  • OS: Ubuntu

[BUG] (minor!) Color messed up after installation

Describe the bug

Colorful output during the ... | bash installation process (v0.2) seems to be missing a closing control char: when installation finishes the terminal has light-grey text (it was originally black). Reproduced a few times.

(bash on debian 10, fwiw)

To Reproduce

Check the terminal is printing in its default color, then run curl -Ls "https://dtsx.io/get-astra-cli" | bash and check again.

astra-cli-greyification

[Feature] - Support for Cql Proxy

Check that docker is installed

docker --version

Check that docker is running

docker ps
  • Commands to start and stop cqlproxy
astra db proxy beam_sdk_integration_test
astra db stop-proxy beam_sdk_integration_test

Start (-d) for detach

docker run -d -p 9042:9042   datastax/cql-proxy:v0.1.4   --astra-token TTT
cql-proxy --astra-token TTTT

Interesting commands for Db to consider

Move Schemas

astra db schema-dump <db> -k <keyspace> -f schema.cql
astra db schema-clone <kb> --source ks1 -- dest ks2

Export data:

astra db backup <db> -k keyspace -f destination
astra db restore <db> -k keyspace -f destination

Clone a db

astra db clone <db> -destination <db2>

[BUG] When `unload` param URL should not be mandatory

Describe the bug

For unload, if url is not provided a default fiiilename should be proposed, today the message is not clear

astra db unload track3 -k data_exploration -t hotels_by_city
[INFO]  Secure connect bundles have been downloaded.
[INFO]  RUNNING: /Users/cedricklunven/.astra/dsbulk-1.10.0/bin/dsbulk unload -u token -p AstraCS:RSgxJhDafxyQxYZtEwnUPYzU:847c6f5e4150261beed6cf01568283a9a25c29e2ea5c9ed51672e48b15e6951b -b /Users/cedricklunven/.astra/scb/scb_f861e773-ab1b-4313-bf3c-8a47412c9ecd_us-east1.zip -k data_exploration -t hotels_by_city -logDir ./logs --log.verbosity normal --schema.allowMissingFields true -maxConcurrentQueries AUTO -delim , -url null -header true -encoding UTF-8 -skipRecords 0 -maxErrors 100
[INFO]  
DSBulk is starting please wait ...
[ERROR] INTERNAL_ERROR: Cannot start process 'dsbulk'

[BUG] Misleading error message when downloading SCB for name-colliding databases

If one has more than one DB with the same name, running

astra db download-scb -f aaa.zip $DB

gives the error for the "Create database" operation, namely [ERROR] ALREADY_EXIST: Cannot create another Database with name 'workshops' Use flag --if-not-exist to connect to the existing database.

This message should be more accurate (and perhaps hint at the fact that you can specify a database by ID).

Specify cloud provider during DB creation

This feedback was captured using a feedback form on datastax.com

While trying to automate an astra db creation via astra CLI I noticed that there's no way to specify the cloud provider. I reviewed the documentation, as well as the help command and it doesn't seem to be a way to change the default cloud provider. Would be great to have an option to do that.

[Feature] - Create backup of an Astra Database

Before allowing to clone databases from the user interface it could be valuable for users to clone DB with backup/restore mechanism

  • Backup an Astra Database
astra db backup mydb \
  -k,--keyspace ks1
  --tables t1,2
  -d,--dest ./tmp
  • Backup an Astra Database Schema
astra db export-schema mydb \
  -k,--keyspace ks1
  --tables t1,2
  -d,--dest ./tmp

[Feature] - Lookup for regions of a cloud

We would need to list the available regions for a cloud and a service

astra org regions list-serverless
astra org regions list-classic
astra db regions list --cloud <cloud>

"resume --wait" does not wait if DB is resuming already

Problem statement

The command astra db resume --wait DB_NAME should return control to the caller only after the DB is back to ACTIVE state.

A working case

If the target database is in HIBERNATED state, all good: the resume --wait command takes one minute or so, and we are back to the shell with the DB in active mode:

$>  astra db list
+---------------------+--------------------------------------+---------------------+----------------+
| Name                | id                                   | Default Region      | Status         |
+---------------------+--------------------------------------+---------------------+----------------+
| tiktok_workshop_db  | 385774d6-064d-4654-873a-4e1b843e379e | eu-central-1        | HIBERNATED     |
| data-modeling       | f4af86f0-1d56-4f9f-b676-2a86d06daee0 | us-east-1           | HIBERNATED     |
+---------------------+--------------------------------------+---------------------+----------------+

$>  astra db resume --wait data-modeling
[ INFO ] - Database 'data-modeling' is resuming
[ INFO ] - Database 'data-modeling' has status 'RESUMING' waiting to be 'ACTIVE' ...
[ INFO ] - Database 'data-modeling' has status 'ACTIVE' (took 59944 millis)

$>  astra db list
+---------------------+--------------------------------------+---------------------+----------------+
| Name                | id                                   | Default Region      | Status         |
+---------------------+--------------------------------------+---------------------+----------------+
| tiktok_workshop_db  | 385774d6-064d-4654-873a-4e1b843e379e | eu-central-1        | HIBERNATED     |
| data-modeling       | f4af86f0-1d56-4f9f-b676-2a86d06daee0 | us-east-1           | ACTIVE         |
+---------------------+--------------------------------------+---------------------+----------------+

The non-working case

I would expect that when --waiting on a database that happens to be already RESUMING, the command nevertheless waits and gives me control back only when the database is active again. This is however not what happens: for an already-resuming database, control is given immediately to the caller and the database is still resuming. Essentially, it behaves as if the --wait clause is ignored in this case:

$>  astra db list
+---------------------+--------------------------------------+---------------------+----------------+
| Name                | id                                   | Default Region      | Status         |
+---------------------+--------------------------------------+---------------------+----------------+
| tiktok_workshop_db  | 385774d6-064d-4654-873a-4e1b843e379e | eu-central-1        | HIBERNATED     |
| data-modeling       | f4af86f0-1d56-4f9f-b676-2a86d06daee0 | us-east-1           | ACTIVE         |
+---------------------+--------------------------------------+---------------------+----------------+

$>  astra db resume tiktok_workshop_db
[ INFO ] - Database 'tiktok_workshop_db' is resuming

$>  astra db list
+---------------------+--------------------------------------+---------------------+----------------+
| Name                | id                                   | Default Region      | Status         |
+---------------------+--------------------------------------+---------------------+----------------+
| tiktok_workshop_db  | 385774d6-064d-4654-873a-4e1b843e379e | eu-central-1        | RESUMING       |
| data-modeling       | f4af86f0-1d56-4f9f-b676-2a86d06daee0 | us-east-1           | ACTIVE         |
+---------------------+--------------------------------------+---------------------+----------------+

$>  astra db resume --wait tiktok_workshop_db
[WARN ] - Database 'tiktok_workshop_db'is already resuming, please wait

$>  astra db list
+---------------------+--------------------------------------+---------------------+----------------+
| Name                | id                                   | Default Region      | Status         |
+---------------------+--------------------------------------+---------------------+----------------+
| tiktok_workshop_db  | 385774d6-064d-4654-873a-4e1b843e379e | eu-central-1        | RESUMING       |
| data-modeling       | f4af86f0-1d56-4f9f-b676-2a86d06daee0 | us-east-1           | ACTIVE         |
+---------------------+--------------------------------------+---------------------+----------------+

Proposed fix

If there is a polling loop associated to the --wait clause, this should be entered not only for HIBERNATED databases but rather for a set of starting states which should include RESUMING as well.

[Feature] - Create backup of a local cassandra cluster

Migration from Cassandra to Astra can take place through a local backup of a cassandra DB:

  • Export Schema
astra migration cassandra-export-schema \
  --host localhost \
  --username cassandra \
  --password cassandra \
  -k,--keyspace ks1
 --tables t1,t2,t3
 -d,--dest ./tmp
  • Export tables (schema + data)
astra migration cassandra-backup \
  --host localhost \
  --username cassandra \
  --password cassandra \
  -k,--keyspace ks1
 --tables t1,t2,t3
 -d,--dest ./tmp

[Feature] Support CDC endpoints

It would be nice to be able to GET/DELETE/POST to CDC endpoints. Here's an example POST

curl -X POST ${WEB_SERVICE_URL}/admin/v3/astra/tenants/${TENANT}/cdc \
  --header "Authorization: ${TOKEN}" \
  --header "X-DataStax-Pulsar-Cluster: ${CLUSTER_NAME}" \
  --data '{
  "databaseId": "'${DB_ID}'",
  "databaseName": "'${DB_NAME}'",
  "keyspace": "'${KEYSPACE_NAME}'",
  "orgId": "'${ORG_ID}'",
  "tableName": "'${TABLE_NAME}'",
  "topicPartitions": 3
}'

And an example GET

curl -X GET ${WEB_SERVICE_URL}/admin/v3/astra/tenants/${TENANT}/cdc \
  --header "Authorization: ${TOKEN}" \
  --header "X-DataStax-Pulsar-Cluster: ${CLUSTER_NAME}"

[BUG] Installing the CLI breaks the SDKMAN autocompletion

After installing the astra cli, the sdkman autocompletion doesn't work anymore

#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

#THIS MUST BE AT THE END OF THE FILE FOR ASTRA_CLI TO WORK!!!
export ASTRADIR="/Users/nicolo.boschi/.astra/cli"
[[ -s "/Users/nicolo.boschi/.astra/cli/astra-init.sh" ]] && source "/Users/nicolo.boschi/.astra/cli/astra-init.sh"

Commenting the astra cli initialization script, sdkman gets back to work

I suppose the astra-init.sh overrides some functions that are in the sdkman init as well

[BUG] - download-scb help message: mention possibility of DB ID and fix description

In v0.2, the help for e.g. the download-scb command says:

steo@tester> astra help db download-scb 
NAME
        astra db download-scb - Delete an existing database

[...]
        <DB>
            Database name (not unique)

(1) Note that it says "Delete an existing database" as command description

(2) and at the end (I think this is true for most commands) it does not mention that you can use a DB ID for the placeholder <DB>. My suggestion is to rephrase this last bit to say something to the effect of Database name or ID. Use the ID if name is not unique.

[BUG] - Folder not found with brew installation

Describe the bug

When installed with brew the folders /.astra and ~/astra/scb are not created.

To Reproduce

Steps to reproduce the behavior:

  1. Name of command...
  2. Options...

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. MacOS]
  • Version [e.g. 0.1.XXX]

Additional context
Add any other context about the problem here.

[BUG] - Create Tenant failling in native mode

Describe the bug

astra streaming create ...

would return a

Exception in thread "main" com.oracle.svm.core.jdk.UnsupportedFeatureError: Runtime reflection is not supported for public java.lang.String com.dtsx.astra.sdk.streaming.domain.CreateTenant.getClusterName()
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89)
	at [email protected]/java.lang.reflect.Method.acquireMethodAccessor(Method.java:76)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:566)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:688)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:772)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:479)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:318)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4719)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3964)
	at com.dtsx.astra.sdk.utils.JsonUtils.marshall(JsonUtils.java:209)
	at com.dtsx.astra.sdk.streaming.AstraStreamingClient.create(AstraStreamingClient.java:94)
	at com.dtsx.astra.cli.streaming.ServiceStreaming.createStreamingTenant(ServiceStreaming.java:394)
	at com.dtsx.astra.cli.streaming.StreamingCreateCmd.execute(StreamingCreateCmd.java:85)
	at com.dtsx.astra.cli.core.AbstractConnectedCmd.run(AbstractConnectedCmd.java:62)
	at com.dtsx.astra.cli.AstraCli.run(AstraCli.java:273)
	at com.dtsx.astra.cli.AstraCli.main(AstraCli.java:248)

Field needs to be exposed in the reflection-config.json

[BUG] - DSBulk does not accept free parameters with native image

Describe the bug

Given : the native image v0.1 (used in Katapod Scenarios), when

astra db dsbulk data-modeling load \
            -url performers.csv \
            -k music_data \
            -t performers \
            -header true \
            -logDir /tmp/logs

Then the following error is triggered:

[ERROR] Found unexpected parameters: [data-modeling, load, -url, /Users/cedricklunven/Downloads/performers.csv, -k, music_data, -t, performers, -header, true, -logDir, /tmp/logs] (ParseArgumentsUnexpectedException)
[ERROR] Try 'astra help db dsbulk data-modeling' to get help

Desktop (please complete the following information):

  • OS: Any OS
  • Version 0.1

Additional context

  • The problem is only reproduced with native image.

The following test is passing

@Test
    public void test() {
        assertSuccessCli("db dsbulk data-modeling load " +
                "-url /Users/cedricklunven/Downloads/performers.csv " +
                "-k music_data " +
                "-t performers " +
                "-header true " +
                "-logDir /tmp/logs");
    }

The following command is passing:

 java -jar ./target/astra-cli-0.1-shaded.jar db dsbulk data-modeling load \
            -url performers.csv \
            -k music_data \
            -t performers \
            -header true \
            -logDir /tmp/logs

[Enhancement] - Show free tiers in region lists

Reported by @synedra

When list of available regions for DB and STREAMING is displayed we should mark the one is free tier

+----------------+-------------------------+------------------------------------+
| Cloud Provider | Region                  | Full Name                          |
+----------------+-------------------------+------------------------------------+
| aws            | ap-east-1               | Asia Pacific (Hong Kong)           |
| aws            | ap-south-1              | Asia Pacific (Mumbai)              |
| aws            | ap-southeast-1          | Asia Pacific (Singapore)           |
| aws            | ap-southeast-2          | Asia Pacific (Sydney)              |
| aws            | eu-central-1            | Europe (Frankfurt)                 |
| aws            | eu-west-1               | Europe (Ireland)                   |
| aws            | sa-east-1               | South America (Sao Paulo)          |
| aws            | us-east-1               | US East (N. Virginia)              |
| aws            | us-east-2               | US East (Ohio)                     |
| aws            | us-west-2               | US West (Oregon)                   |
| azure          | australiaeast           | Australia East                     |
| azure          | canadacentral           | Canada Central (Toronto)           |
| azure          | centralindia            | Central India (Pune)               |
| azure          | eastus                  | US East                            |
| azure          | eastus2                 | US East 2 (Virginia)               |
| azure          | francecentral           | France Central                     |
| azure          | westeurope              | West Europe                        |
| azure          | westus2                 | US West (Washington)               |
| gcp            | asia-east2              | Asia East2 (Hong Kong, APAC)       |
| gcp            | asia-northeast1         | Asia Northeast1 (Tokyo, Japan)     |
| gcp            | asia-south1             | Mumbai, India                      |
| gcp            | australia-southeast1    | Sydney, Australia, APAC            |
| gcp            | europe-west1            | St. Ghislain, Belgium              |
| gcp            | europe-west2            | West Europe2 (London, England, UK) |
| gcp            | northamerica-northeast1 | Montreal, Quebec                   |
| gcp            | northamerica-northeast2 | Toronto, Ontario                   |
| gcp            | us-central1             | Council Bluffs, Iowa               |
| gcp(FREE-TIER) | us-east1                | Moncks Corner, South Carolina      |
| gcp            | us-east4                | Ashburn, Virginia                  |
| gcp            | us-west1                | The Dalles, Oregon                 |
| gcp            | us-west4                | US West (Las Vegas, USA)           |
+----------------+-------------------------+------------------------------------+

Dotenv creation should preserve pre-existing extraneous env var definitions

Current behaviour
At the moment (v0.1.1), if you have a .env already with your own var definitions, create-dotenv overwrites it.

Use case:
We may have other env vars we want to have in the final, complete dotenv (extraneous to astra but needed by the app).

Ideally the create-dotenv might take care of preserving env var definitions that do not overlap with those it creates.

This would make it easier to end up with a final .env such as:

MY_SETTING="abc"
NUMBER_OF_FRZSQQY="123"
ASTRA_DB_APPLICATION_TOKEN="AstraCS:..."
# (other AstraDB stuff ...)

something that at the moment is achieved with a supplementary file and a cat XXX >> .env afterwards.
This comes up now and then e.g. in workshops.

Implementation
I wouldn't be so fussy about preserving empty lines, comments, ordering and the like. As long as it satisfies the above it's good enough as a first version.

(then, perhaps later, it could "remember" the location of pre-existing Astra DB env vars and preserve it, plus appending at the end with a prefix comment those that did not appear previously, or something like that. But that's secondary)

[Feature] - Manage regions for a database

With Astra DB a database can live in one or multiple regions. As such the list should allow the CRUD operations.

We would like to avoid complex command with multiple levels so create-region is valid instead of astra db region create. We had the same approach with keyspaces. It also eases user experience and autocompletion.

List current regions for a db

astra db list-regions <mydb>

Create a region (region name must be valid).

The option --wait will NOT be available as such operations takes easily 30minutes even an empty db.

astra db create-region <mydb> -r regionName

Delete a region (region name must be valid).

The option --wait will NOT be available as such operations takes easily 30minutes even an empty db.

astra db delete-region <mydb> -r regionName

List available regions for this particular db

As of Today databases can be installed across multiple regions of THE SAME CLOUD PROVIDER. As such it would be useful to list possibilities for this particular db.

astra db available-regions <mydb>

[BUG] cqlsh not launching due to: "AttributeError: module 're' has no attribute 'sre_parse'"

Describe the bug

astra db cqlsh <db-name> fails due to an error. Astra CLI can't run cqlsh.

To Reproduce

run: astra db cqlsh <db-name>

Expected behavior
It's expected that this command successfully launches cqlsh connected to

Screenshots
n/a

Desktop (please complete the following information):

  • OS: MacOS w/zsh,
  • python 3.11.3

Additional context
full output:

[INFO] Cqlsh is starting, please wait for connection establishment... Traceback (most recent call last): File "/Users/mattkennedy/.astra/cqlsh-astra/bin/dsecqlsh.py", line 95, in <module> import cqlsh # nopep8 ^^^^^^^^^^^^ File "/Users/mattkennedy/.astra/cqlsh-astra/bin/cqlsh.py", line 185, in <module> from cqlshlib import cql3handling, pylexotron, sslhandling, cqlshhandling File "/Users/mattkennedy/.astra/cqlsh-astra/bin/../pylib/cqlshlib/cql3handling.py", line 19, in <module> from cqlshlib.cqlhandling import CqlParsingRuleSet, Hint File "/Users/mattkennedy/.astra/cqlsh-astra/bin/../pylib/cqlshlib/cqlhandling.py", line 23, in <module> from cqlshlib import pylexotron, util File "/Users/mattkennedy/.astra/cqlsh-astra/bin/../pylib/cqlshlib/pylexotron.py", line 342, in <module> class ParsingRuleSet: File "/Users/mattkennedy/.astra/cqlsh-astra/bin/../pylib/cqlshlib/pylexotron.py", line 343, in ParsingRuleSet RuleSpecScanner = SaferScanner([ ^^^^^^^^^^^^^^ File "/Users/mattkennedy/.astra/cqlsh-astra/bin/../pylib/cqlshlib/saferscanner.py", line 91, in __init__ s = re.sre_parse.State() ^^^^^^^^^^^^ AttributeError: module 're' has no attribute 'sre_parse'

Inconsistency between DB and streaming commands

This may be a deeper issue than the CLI, but I'll start here. I have found a few inconsistencies between commands. Specifically the --cloud and --region parameters.

To create a DB in GCP us central 1:
astra db create --keyspace my-keyspace --cloud "GCP" --region "us-central1" a-db

To create a tenant in GCP us central 1:
astra streaming create --cloud "gcp" --region "uscentral1" a-tenant

It would be nice for the cloud and region values to be the same for both.

Arbitrary parameter passed over to DSBulk, cqlsh and the like

Is your feature request related to a problem? Please describe.
Apparently, it is not possible to pass every possible DSBulk command-line param when invoking through Astra CLI.

Describe the solution you'd like
A way to pass any parameter over to the invoked target utility (dsbulk, cqlsh) "as is".

Describe alternatives you've considered
Mapping all parameters, and their syntax and constraints, within astra-cli to later reconstruct the full command-line when invoking the target utility is a double effort and would require maintenance every time these tools evolve.

Disclaimer: I know this is not easy given the current tools to parse astra-cli's command line parameters.

[BUG] Astra cli fails when installed in Macos via homebrew

Describe the bug

I followed the step-by-step Astra CLI documentation linked in the "Connect" tab on Astra UI. After installing it with brew install datastax/astra-cli/astra-cli, the second step is to run astra setup which fails with LinkageError. See below.

To Reproduce

(prod) ~ % astra setup
Error: LinkageError occurred while loading main class com.dtsx.astra.cli.AstraCli
	java.lang.UnsupportedClassVersionError: com/dtsx/astra/cli/AstraCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
(prod) ~ % astra --version
Error: LinkageError occurred while loading main class com.dtsx.astra.cli.AstraCli
	java.lang.UnsupportedClassVersionError: com/dtsx/astra/cli/AstraCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
(prod) ~ %

Expected behavior
The command should work as expected or throw a user-friendly error message with helpful information on how to fix it.

Desktop (please complete the following information):

  • OS: MacOS (13.2.1 (22D68))
  • Version: stable 0.2.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.