Golang client sources for Astra.
astra-client-go's Introduction
astra-client-go's People
Forkers
phact dynajoe sharan-datastax emerkle826 jdonenine bradfordcp isabella232 zzzming pgier rdjyastra-client-go's Issues
get indexes response is incorrect
The response of get indexes is defined as an array of IndexResponse
astra-client-go/rest-api-swagger.yaml
Lines 428 to 436 in c640f33
while IndexResponse is also of array type,
astra-client-go/rest-api-swagger.yaml
Lines 1238 to 1241 in c640f33
However, the actual response is not in nested array structure.
$ curl -s -H 'Content-Type: application/json' -H "X-Cassandra-Token: ${ASTRA_DB_TOKEN}" \
https://${ASTRA_DB_ID}-${ASTRA_DB_REGION}.apps.astra.datastax.com/api/rest/v2/schemas/keyspaces/${ASTRA_DB_KEYSPACE}/tables/foo/indexes \
| jq .
[
{
"keyspace_name": "ghoti",
"table_name": "foo",
"index_name": "foo_lastname_idx",
"kind": "CUSTOM",
"options": [
{
"key": "class_name",
"value": "org.apache.cassandra.index.sai.StorageAttachedIndex"
},
{
"key": "target",
"value": "lastname"
}
]
}
]
TERRA-39 ⁃ OpenAPI spec needs improvement and corrections, primaryly related to `databaseID` and `datacenterID`
A number of elements of the OpenAPI spec are incorrect or incomplete including:
- Roles should be specified as an array of objects
- CloudProviders should be specified as a set of enums since they are limited and specific in nature
- Paths related to
databaseID
anddatacenterID
do not use the correct case and should instead bedatabaseId
anddatacenterId
┆Issue is synchronized with this Jira Task by Unito
┆fixVersions: v1.1.0
┆friendlyId: TERRA-39
┆priority: Major
Some of the WithResponse functions swallow the real error when they can't parse the response.
Instead of the actual error, the caller just sees this generic message:
json: cannot unmarshal string into Go value of type astra.Errors
See this issue and related PR for example:
datastax/terraform-provider-astra#227
datastax/terraform-provider-astra#298
response from get table request is not parsed properly
Summary
The response from get table request is not parsed properly
sample code
func tryGetTable(ctx context.Context, client *restapi.ClientWithResponses, keyspaceName string, tableName string) {
rsp, err := client.GetTableWithResponse(ctx, keyspaceName, tableName, &restapi.GetTableParams{})
if err != nil {
panic(err)
}
enc := json.NewEncoder(os.Stdout)
enc.Encode(rsp.JSON200)
}
expected result
{"columnDefinitions":[{"name":"firstname","static":false,"typeDefinition":"text"},{"name":"lastname","static":false,"typeDefinition":"text"}],"keyspace":"ghoti","name":"foo","primaryKey":{"clusteringKey":[],"partitionKey":["firstname"]},"tableOptions":{"clusteringExpression":[],"defaultTimeToLive":0}}
actual result
{"columnDefinitions":null,"name":"","primaryKey":{"partitionKey":null}}
invesitigation
there is a top level data
key in the response
$ curl -s -H 'Content-Type: application/json' -H "X-Cassandra-Token: ${ASTRA_DB_TOKEN}" \
https://${ASTRA_DB_ID}-${ASTRA_DB_REGION}.apps.astra.datastax.com/api/rest/v2/schemas/keyspaces/${ASTRA_DB_KEYSPACE}/tables/foo \
| jq .
{
"data": {
"name": "foo",
"keyspace": "ghoti",
"columnDefinitions": [
{
"name": "firstname",
"typeDefinition": "text",
"static": false
},
{
"name": "lastname",
"typeDefinition": "text",
"static": false
}
],
"primaryKey": {
"partitionKey": [
"firstname"
],
"clusteringKey": []
},
"tableOptions": {
"defaultTimeToLive": 0,
"clusteringExpression": []
}
}
}
It should be included in the specification here
astra-client-go/rest-api-swagger.yaml
Lines 210 to 216 in c640f33
TERRA-84 ⁃ Add support for deleting Keyspaces
Streaming support v0
Adding support for streaming via the public bellburnel api in this commit:
Added a step to the makefile and a streaming yaml.
Type of create index response incorrect
Type of create index
response incorrect. It should by object instead of string. The actual result is
{
"success": true
}
The example in the SPEC (line 467) is correct.
astra-client-go/rest-api-swagger.yaml
Lines 459 to 467 in c640f33
docs and examples
I am sure this is on the todo list somewhere but this is something I would be willing to help with.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.