Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC-4592: Astra CLI version 0.6 #18

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open

DOC-4592: Astra CLI version 0.6 #18

wants to merge 43 commits into from

Conversation

eric-schneider
Copy link
Contributor

@eric-schneider eric-schneider commented Sep 12, 2024

Jira: DOC-4592
Draft previews:

Notes to reviewers

@clun I marked the following issues with TODO:

Issue 1

I commented out the following statement in db create options because it did not align with the behavior I observed:

The database ID, not the database name, ensures uniqueness within your {astra_db} organization.
Consequently, if you issue the `astra db create` command multiple times, you will create multiple database instances.
To ensure that you don't create a database with the same name as another existing database, use the `--if-not-exist` option:

[source,bash]
----
astra db create demo -r us-east-1 -k keyspace1 --if-not-exist
----

Issue 2

I couldn't get the following command to work in Manage multi-region databases, and therefore couldn't provide a Result:

astra db create-region DATABASE_NAME -r REGION

I kept getting the following error: [ERROR] UNAVAILABLE: Database 'my_serverless_db' has been found but operation cannot be processed due to invalid state (ACTIVE) expected (ACTIVE)

Issue 3

I couldn't get the following command to work in Change Data Capture (CDC), and therefore couldn't provide a Result:

astra db create-cdc DATABASE_NAME \
    -k KEYSPACE_NAME \
    --table TABLE_NAME \
    --tenant TENANT_NAME

I kept getting the following error: [ERROR] INVALID_ARGUMENT: Error Code=422(422) Invalid information provided to create DB: 422 Unprocessable Entity: databaseId, keyspace, tableName, and orgId are mandatory fields

Issue 4

I couldn't get the following command to work in Change Data Capture (CDC), and therefore couldn't provide a Result:

astra db delete-cdc DATABASE_NAME \
    -k KEYSPACE_NAME \
    --table TABLE_NAME \
    --tenant TENANT_NAME

I kept getting the following error: [ERROR] INVALID_ARGUMENT: Error Code=422(422) Invalid information provided to create DB: 422 Unprocessable Entity: databaseId, keyspace, tableName, and orgId are mandatory fields

Issue 5

I couldn't get the following command to work in End-to-end example, and therefore couldn't provide a Result:

astra db create-cdc cdc_demo_db \
    -k cdc_demo_keyspace \
    --table cdc_demo_table \
    --tenant cdc-demo-tenant

I kept getting the following error: [ERROR] INVALID_ARGUMENT: Error Code=422(422) Invalid information provided to create DB: 422 Unprocessable Entity: databaseId, keyspace, tableName, and orgId are mandatory fields

Issue 6

I couldn't get the following command to work in streaming pulsar-shell options, and therefore couldn't provide a Result:

astra streaming pulsar-shell TENANT_NAME -e "admin namespaces list TENANT_NAME"

I kept getting a long Java-related error.

Issue 7

In streaming pulsar-shell options, we should provide an actual sample.txt file for the user and corresponding Result for the following command:

astra streaming pulsar-shell TENANT_NAME -f sample.txt

Issue 8

I couldn't get the following command to work in Pulsar-shell example, and therefore couldn't provide a Result:

admin topics create persistent://my-streaming-tenant/default/demo

I kept getting a long Java-related error.

Also, because I couldn't get this command to work, I couldn't test the other commands and simply had to copy over the Results from Awesome Astra.

Issue 9

I couldn't get the following command to work in Get a list of tokens, and therefore couldn't provide a Result:

astra token list

I kept getting the following error: [ERROR] NOT_FOUND: Role 'ad905142-21a6-4ea8-839c-183d2d52ea9c' has not been found.

Issue 10

I couldn't get auto-completion to work. We need to provide full instructions for making this work on Linux and macOS.

@eric-schneider eric-schneider self-assigned this Sep 12, 2024
@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@eric-schneider eric-schneider changed the title DOC-4592: Prepare for version 0.6 DOC-4592: Astra CLI version 0.5 Nov 18, 2024
@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds

This comment was marked as outdated.

@plpesvc-ds
Copy link

plpesvc-ds commented Jan 7, 2025

Build successful! ✅
Deploying draft.
Deploy successful! View draft

@clun
Copy link

clun commented Jan 8, 2025

Issue 1

You are correct. The comment was misleading. It makes sense when you read a db but not when you create one. Let us say you have 2 db with same names

$astra db list

+--------------------------------------+--------------------------------------+-----------+-------+---+-----------+
| Name                                 | id                                   | Regions   | Cloud | V | Status    |
+--------------------------------------+--------------------------------------+-----------+-------+---+-----------+
| dev                                  | f7128be6-781d-46a6-bee2-09b649aca4fb | ap-south-1| aws   | ■ | ACTIVE    |
| dev                                  | 23887598-053d-455e-8c0b-9416b0e0a740 | ap-south-1| aws   | ■ | ACTIVE    |
+--------------------------------------+--------------------------------------+-----------+-------+---+-----------+

This command will failed

astra db get dev

This command will success

astra db get f7128be6-781d-46a6-bee2-09b649aca4fb

Issue 2

astra db create-region source_db -r us-east-2 
[ERROR] UNAVAILABLE: Database 'source_db' has been found but operation cannot be processed due to invalid state (ACTIVE) expected (ACTIVE)
  • The error message is misleading, any error will get this message
try {
// here some code
} catch(Exception e) {
   throw new InvalidDatabaseStateException(databaseName, DatabaseStatusType.ACTIVE,
      dbDao.getDatabase(databaseName).getStatus());
}

@eric-schneider
Copy link
Contributor Author

@clun regarding Issue 1, here's the behavior I observed (sorry I didn't include this info previously).

Create first DB named demo:

astra db create demo -c aws -r us-east-1 -k keyspace1

REGION OK
[INFO]  Database 'demo' does not exist. Creating database 'demo' with keyspace 'keyspace1'
get CLoud provider
[INFO]  Database 'demo' and keyspace 'keyspace1' are being created.
[INFO]  Database 'demo' has status 'PENDING' waiting to be 'ACTIVE' ...
[INFO]  Database 'demo' has status 'ACTIVE' (took 111491 millis)
[OK]    Database 'demo' is ready.

Create second DB named demo:

astra db create demo -c aws -r us-east-1 -k keyspace1

REGION OK
[ERROR] ALREADY_EXIST: A database with name 'demo' already exists in the organization. To prevent conflicts CLI will not create another one, please change name

^ The CLI doesn't let me create a second DB named demo. However, I was able to create it in the Astra Portal:

image

With the --if-not-exist option:

astra db create demo -c aws -r us-east-1 -k keyspace1 --if-not-exist

REGION OK
[INFO]  Database 'demo' already exist. Connecting to database.
[INFO]  Keyspace  'keyspace1' already exists. Connecting to keyspace.
[OK]    Database 'demo' is ready.

^ The --if-not-exist option appears to work as expected, however it seems a little pointless because the CLI doesn't let you create duplicate DB names in the first place.

@plpesvc-ds
Copy link

plpesvc-ds commented Jan 11, 2025

Build successful! ✅
Deploying draft.
Deploy successful! View draft

@msmygit
Copy link

msmygit commented Jan 21, 2025

Astra CLI 0.6 was released last week so, let's update to that as well please

@eric-schneider eric-schneider changed the title DOC-4592: Astra CLI version 0.5 DOC-4592: Astra CLI version 0.6 Jan 22, 2025
@plpesvc-ds
Copy link

plpesvc-ds commented Jan 24, 2025

Build successful! ✅
Deploying draft.
Deploy successful! View draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants