I have a Cosmos DB (Cassandra API) instance set up and I'd like to manage it's throughput from a Python application. I'm able to create a azure.cosmos.cosmos_client using the cassandra endpoint and primary password listed in Azure without errors, but all attempted interactions with the client result in "azure.cosmos.errors.HTTPFailure: Status code: 404".
I am already successfully interacting with this database through cassandra-driver in Python, but I'd like access to the cosmos-client to manage throughput provisioning via code. I want to autoscale throughput as database use fluctuates between high levels of utilization and almost no activity.
Creating a cosmos_client requires a valid URI, with schema (https/http/ftp etc...) included. The endpoint listed on azure which was successfully used to connect via cqlsh as well as the Python cassandra-driver did not specify schema. I added "https://" to the beginning of the provided endpoint and was able to create the client in Python ("http://" results in errors, also verified incorrect addresses also result in errors even with "https://"). Now that I have a client object created, any interaction I attempt with it gives me 404 errors.
client = cosmos_client.CosmosClient(f'https://{COSMOS_CASSANDRA_ENDPOINT}', {'masterKey': COSMOS_CASSANDRA_PASSWORD} )
client.ReadEndpoint
#'https://COSMOS_CASSANDRA_ENDPOINT'
client.GetDatabaseAccount(COSMOS_CASSANDRA_ENDPOINT)
#azure.cosmos.errors.HTTPFailure: Status code: 404
client.ReadDatabase(EXISTING_KEYSPACE_NAME)
#azure.cosmos.errors.HTTPFailure: Status code: 404
I'm wondering if using the cosmos_client is the correct way to interact with the Cosmos Cassandra instance to modify throughput from my Python application. If so, how should I set up the cosmos_client properly? Perhaps there is a way to do this directly through database modifications using cassandra-driver.