Merge pull request #306 from dougwettlaufer/feature/http-schema-update

Use http requests when creating schema for rest and graphql
This commit is contained in:
Jonathan Shook 2021-04-21 17:32:48 -05:00 committed by GitHub
commit deff1fe94c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 196 additions and 50 deletions

View File

@ -29,23 +29,76 @@ blocks:
- name: schema - name: schema
tags: tags:
phase: schema phase: schema
params:
prepared: false
statements: statements:
- create-keyspace: | - create-keyspace: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8082>><<path_prefix:>>/v2/schemas/keyspaces
create keyspace if not exists <<keyspace:baselines>> Accept: "application/json"
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '<<rf:1>>'} X-Cassandra-Request-Id: "{request_id}"
AND durable_writes = true; X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"name": "<<keyspace:baselines>>",
"replicas": <<rf:1>>
}
tags: tags:
name: create-keyspace name: create-keyspace
- create-table: | - create-table: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8082>><<path_prefix:>>/v2/schemas/keyspaces/<<keyspace:baselines>>/tables
create table if not exists <<keyspace:baselines>>.<<table:keyvalue>> ( Accept: "application/json"
key text, X-Cassandra-Request-Id: "{request_id}"
value text, X-Cassandra-Token: "<<auth_token:my_auth_token>>"
PRIMARY KEY (key) Content-Type: "application/json"
); body: |
{
"name": "<<table:keyvalue>>",
"columnDefinitions": [
{
"name": "key",
"typeDefinition": "text"
},
{
"name": "value",
"typeDefinition": "text"
}
],
"primaryKey": {
"partitionKey": [
"key"
]
},
"ifNotExists": true
}
tags: tags:
name: create-table name: create-table
- tags:
phase: schema-astra
statements:
- create-table-astra: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8082>><<path_prefix:>>/v2/schemas/keyspaces/<<keyspace:baselines>>/tables
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"name": "<<table:keyvalue>>",
"columnDefinitions": [
{
"name": "key",
"typeDefinition": "text"
},
{
"name": "value",
"typeDefinition": "text"
}
],
"primaryKey": {
"partitionKey": [
"key"
]
},
"ifNotExists": true
}
tags:
name: create-table-astra
- name: rampup - name: rampup
tags: tags:
phase: rampup phase: rampup

View File

@ -37,24 +37,90 @@ blocks:
- name: schema - name: schema
tags: tags:
phase: schema phase: schema
params:
prepared: false
statements: statements:
- create-keyspace: | - create-keyspace: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8082>><<path_prefix:>>/v2/schemas/keyspaces
create keyspace if not exists <<keyspace:baselines>> Accept: "application/json"
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '<<rf:1>>'} X-Cassandra-Request-Id: "{request_id}"
AND durable_writes = true; X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"name": "<<keyspace:baselines>>",
"replicas": <<rf:1>>
}
tags: tags:
name: create-keyspace name: create-keyspace
- create-table: | - create-table: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8082>><<path_prefix:>>/v2/schemas/keyspaces/<<keyspace:baselines>>/tables
create table if not exists <<keyspace:baselines>>.<<table:tabular>> ( Accept: "application/json"
part text, X-Cassandra-Request-Id: "{request_id}"
clust text, X-Cassandra-Token: "<<auth_token:my_auth_token>>"
data text, Content-Type: "application/json"
PRIMARY KEY (part,clust) body: |
); {
"name": "<<table:tabular>>",
"columnDefinitions": [
{
"name": "part",
"typeDefinition": "text"
},
{
"name": "clust",
"typeDefinition": "text"
},
{
"name": "data",
"typeDefinition": "text"
}
],
"primaryKey": {
"partitionKey": [
"part"
],
"clusteringKey": [
"clust"
]
},
"ifNotExists": true
}
tags: tags:
name: create-table name: create-table
- tags:
phase: schema-astra
statements:
- create-table-astra: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8082>><<path_prefix:>>/v2/schemas/keyspaces/<<keyspace:baselines>>/tables
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{
"name": "<<table:tabular>>",
"columnDefinitions": [
{
"name": "part",
"typeDefinition": "text"
},
{
"name": "clust",
"typeDefinition": "text"
},
{
"name": "data",
"typeDefinition": "text"
}
],
"primaryKey": {
"partitionKey": [
"part"
],
"clusteringKey": [
"clust"
]
},
"ifNotExists": true
}
tags:
name: create-table-astra
- name: rampup - name: rampup
tags: tags:
phase: rampup phase: rampup

View File

@ -30,23 +30,37 @@ blocks:
- name: schema - name: schema
tags: tags:
phase: schema phase: schema
params:
prepared: false
statements: statements:
- create-keyspace: | - create-keyspace: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8080>><<path_prefix:>>/graphql-schema
create keyspace if not exists <<keyspace:gqlcf_keyvalue>> Accept: "application/json"
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '<<rf:1>>'} X-Cassandra-Request-Id: "{request_id}"
AND durable_writes = true; X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{"query":"mutation {\n createKeyspace(name:\"<<keyspace:gqlcf_tabular>>\", replicas: <<rf:1>>, ifNotExists: true)\n}"}
tags: tags:
name: create-keyspace name: create-keyspace
- create-table: | - create-table: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8080>><<path_prefix:>>/graphql-schema
create table if not exists <<keyspace:gqlcf_keyvalue>>.<<table:keyvalue>> ( Accept: "application/json"
key text, X-Cassandra-Request-Id: "{request_id}"
value text, X-Cassandra-Token: "<<auth_token:my_auth_token>>"
PRIMARY KEY (key) Content-Type: "application/json"
); body: |
{"query":"mutation {\n createTable(\n keyspaceName: \"<<keyspace:gqlcf_keyvalue>>\"\n tableName: \"<<table:keyvalue>>\"\n partitionKeys: [{ name: \"key\", type: { basic: TEXT } }]\n values: [{ name: \"value\", type: { basic: TEXT } }]\n ifNotExists: true\n )\n}"}
tags: tags:
name: create-table name: create-table
- tags:
phase: schema-astra
statements:
- create-table-astra: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8080>><<path_prefix:>>/graphql-schema
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{"query":"mutation {\n createTable(\n keyspaceName: \"<<keyspace:gqlcf_keyvalue>>\"\n tableName: \"<<table:keyvalue>>\"\n partitionKeys: [{ name: \"key\", type: { basic: TEXT } }]\n values: [{ name: \"value\", type: { basic: TEXT } }]\n ifNotExists: true\n )\n}"}
tags:
name: create-table-astra
- name: rampup - name: rampup
tags: tags:
phase: rampup phase: rampup

View File

@ -38,24 +38,37 @@ blocks:
- name: schema - name: schema
tags: tags:
phase: schema phase: schema
params:
prepared: false
statements: statements:
- create-keyspace: | - create-keyspace: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8080>><<path_prefix:>>/graphql-schema
create keyspace if not exists <<keyspace:gqlcf_tabular>> Accept: "application/json"
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '<<rf:1>>'} X-Cassandra-Request-Id: "{request_id}"
AND durable_writes = true; X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{"query":"mutation {\n createKeyspace(name:\"<<keyspace:gqlcf_tabular>>\", replicas: <<rf:1>>, ifNotExists: true)\n}"}
tags: tags:
name: create-keyspace name: create-keyspace
- create-table: | - create-table: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8080>><<path_prefix:>>/graphql-schema
create table if not exists <<keyspace:gqlcf_tabular>>.<<table:tabular>> ( Accept: "application/json"
part text, X-Cassandra-Request-Id: "{request_id}"
clust text, X-Cassandra-Token: "<<auth_token:my_auth_token>>"
data text, Content-Type: "application/json"
PRIMARY KEY (part,clust) body: |
); {"query":"mutation {\n createTable(\n keyspaceName: \"<<keyspace:gqlcf_tabular>>\"\n tableName: \"<<table:tabular>>\"\n partitionKeys: [{ name: \"part\", type: { basic: TEXT } }]\n clusteringKeys: [{ name: \"clust\", type: { basic: TEXT } }]\n values: [{ name: \"data\", type: { basic: TEXT } }]\n ifNotExists: true\n )\n}\n"}
tags: tags:
name: create-table name: create-table
- tags:
phase: schema-astra
statements:
- create-table-astra: POST <<protocol:http>>://{weighted_hosts}:<<stargate_port:8080>><<path_prefix:>>/graphql-schema
Accept: "application/json"
X-Cassandra-Request-Id: "{request_id}"
X-Cassandra-Token: "<<auth_token:my_auth_token>>"
Content-Type: "application/json"
body: |
{"query":"mutation {\n createTable(\n keyspaceName: \"<<keyspace:gqlcf_tabular>>\"\n tableName: \"<<table:tabular>>\"\n partitionKeys: [{ name: \"part\", type: { basic: TEXT } }]\n clusteringKeys: [{ name: \"clust\", type: { basic: TEXT } }]\n values: [{ name: \"data\", type: { basic: TEXT } }]\n ifNotExists: true\n )\n}\n"}
tags:
name: create-table-astra
- name: rampup - name: rampup
tags: tags:
phase: rampup phase: rampup