From eaddc4f03bf8a00202fe2c3b69b7d0ebc1dc3b76 Mon Sep 17 00:00:00 2001 From: Doug Wettlaufer Date: Wed, 26 May 2021 12:15:08 -0500 Subject: [PATCH] Update schema-first workloads to reflect latest api --- .../http-graphql-keyvalue.yaml | 30 +++++++++++++------ .../http-graphql-tabular.yaml | 30 +++++++++++++------ .../http-graphql-timeseries.yaml | 17 +++++------ 3 files changed, 50 insertions(+), 27 deletions(-) diff --git a/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-keyvalue.yaml b/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-keyvalue.yaml index 71a498bb2..d9f346587 100644 --- a/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-keyvalue.yaml +++ b/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-keyvalue.yaml @@ -1,7 +1,6 @@ # nb -v run driver=http yaml=http-graphql-keyvalue tags=phase:schema host=my_stargate_host stargate_host=my_stargate_host auth_token=$AUTH_TOKEN # TODO -# - /graphqlv2 will change in future, adapt when needed # - do we need a truncate schema / namespace at the end description: | @@ -36,34 +35,47 @@ blocks: - tags: phase: schema statements: - - create-keyspace: POST <>://{weighted_hosts}:<><>/graphqlv2/admin + - create-keyspace: POST <>://{weighted_hosts}:<><>/graphql-schema Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | { - "query":"mutation {\n createNamespace(name: \"<>\", replicas: <>) {\n namespace {\n name\n }\n }\n}\n" + "query":"mutation {\n createKeyspace(name: \"<>\", replicas: <>, ifNotExists: true) \n}\n" } tags: name: create-keyspace - - create-gql-schema : POST <>://{weighted_hosts}:<><>/graphqlv2/admin + - create-gql-schema : POST <>://{weighted_hosts}:<><>/graphql-admin Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | { - "query":"mutation {\n deploySchema(namespace: \"<>\", schema: \"\"\"\n type KeyValue @cql_input {\n key: String! @cql_column(partitionKey: true)\n value: String!\n }\n type Query {\n getKeyValue(\n key: String!,\n ): KeyValue\n }\n type Mutation {\n \t\tinsertKeyValue(keyValue: KeyValueInput): KeyValue\n }\n \"\"\") {\n version\n }\n}\n" + "query":"mutation {\n deploySchema(keyspace: \"<>\", schema: \"\"\"\n type KeyValue @cql_input {\n key: String! @cql_column(partitionKey: true)\n value: String!\n }\n type Query {\n getKeyValue(\n key: String!,\n ): KeyValue\n }\n type Mutation {\n \t\tinsertKeyValue(keyValue: KeyValueInput): KeyValue\n }\n \"\"\") {\n version\n }\n}\n" } tags: name: create-gql-schema - + - tags: + phase: schema-astra + statements: + - create-gql-schema : POST <>://{weighted_hosts}:<><>/graphql-admin + Accept: "application/json" + X-Cassandra-Request-Id: "{request_id}" + X-Cassandra-Token: "<>" + Content-Type: "application/json" + body: | + { + "query":"mutation {\n deploySchema(keyspace: \"<>\", schema: \"\"\"\n type KeyValue @cql_input {\n key: String! @cql_column(partitionKey: true)\n value: String!\n }\n type Query {\n getKeyValue(\n key: String!,\n ): KeyValue\n }\n type Mutation {\n \t\tinsertKeyValue(keyValue: KeyValueInput): KeyValue\n }\n \"\"\") {\n version\n }\n}\n" + } + tags: + name: create-gql-schema-astra - name: rampup tags: phase: rampup statements: - - rampup-insert: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - rampup-insert: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" @@ -82,7 +94,7 @@ blocks: params: ratio: <> statements: - - main-select: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - main-select: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" @@ -101,7 +113,7 @@ blocks: params: ratio: <> statements: - - main-write: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - main-write: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" diff --git a/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-tabular.yaml b/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-tabular.yaml index c388008c2..d8a33698f 100644 --- a/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-tabular.yaml +++ b/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-tabular.yaml @@ -1,7 +1,6 @@ # nb -v run driver=http yaml=http-graphql-tabular tags=phase:schema host=my_stargate_host stargate_host=my_stargate_host auth_token=$AUTH_TOKEN # TODO -# - /graphqlv2 will change in future, adapt when needed # - do we need a truncate schema / namespace at the end # - rest uses limit as it queries only by a single primary key, we can not map this to GQL (also should data be clustering key) @@ -45,34 +44,47 @@ blocks: - tags: phase: schema statements: - - create-keyspace: POST <>://{weighted_hosts}:<><>/graphqlv2/admin + - create-keyspace: POST <>://{weighted_hosts}:<><>/graphql-schema Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | { - "query":"mutation {\n createNamespace(name: \"<>\", replicas: <>) {\n namespace {\n name\n }\n }\n}\n" + "query":"mutation {\n createKeyspace(name: \"<>\", replicas: <>, ifNotExists: true) \n}\n" } tags: name: create-keyspace - - create-gql-schema : POST <>://{weighted_hosts}:<><>/graphqlv2/admin + - create-gql-schema : POST <>://{weighted_hosts}:<><>/graphql-admin Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | { - "query":"mutation {\n deploySchema(namespace: \"<>\", schema: \"\"\"\n type Tabular @cql_input {\n part: String! @cql_column(partitionKey: true)\n clust: String! @cql_column(partitionKey: true)\n data: String! \n }\n type SelectTabularResult @cql_payload {\n \t\tdata: [Tabular]\n \t\tpagingState: String\n }\n type Query {\n getTabulars(\n part: String!,\n clust: String!,\n pagingState: String @cql_pagingState\n ): SelectTabularResult @cql_select(pageSize: 10)\n }\n type Mutation {\n \t\tinsertTabular(tabular: TabularInput): Tabular\n }\n \"\"\") {\n version\n }\n}\n" + "query":"mutation {\n deploySchema(keyspace: \"<>\", schema: \"\"\"\n type Tabular @cql_input {\n part: String! @cql_column(partitionKey: true)\n clust: String! @cql_column(partitionKey: true)\n data: String! \n }\n type SelectTabularResult @cql_payload {\n \t\tdata: [Tabular]\n \t\tpagingState: String\n }\n type Query {\n getTabulars(\n part: String!,\n clust: String!,\n pagingState: String @cql_pagingState\n ): SelectTabularResult @cql_select(pageSize: 10)\n }\n type Mutation {\n \t\tinsertTabular(tabular: TabularInput): Tabular\n }\n \"\"\") {\n version\n }\n}\n" } tags: name: create-gql-schema - + - tags: + phase: schema-astra + statements: + - create-gql-schema : POST <>://{weighted_hosts}:<><>/graphql-admin + Accept: "application/json" + X-Cassandra-Request-Id: "{request_id}" + X-Cassandra-Token: "<>" + Content-Type: "application/json" + body: | + { + "query":"mutation {\n deploySchema(keyspace: \"<>\", schema: \"\"\"\n type Tabular @cql_input {\n part: String! @cql_column(partitionKey: true)\n clust: String! @cql_column(partitionKey: true)\n data: String! \n }\n type SelectTabularResult @cql_payload {\n \t\tdata: [Tabular]\n \t\tpagingState: String\n }\n type Query {\n getTabulars(\n part: String!,\n clust: String!,\n pagingState: String @cql_pagingState\n ): SelectTabularResult @cql_select(pageSize: 10)\n }\n type Mutation {\n \t\tinsertTabular(tabular: TabularInput): Tabular\n }\n \"\"\") {\n version\n }\n}\n" + } + tags: + name: create-gql-schema-astra - name: rampup tags: phase: rampup statements: - - rampup-insert: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - rampup-insert: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" @@ -91,7 +103,7 @@ blocks: params: ratio: <> statements: - - main-select: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - main-select: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" @@ -110,7 +122,7 @@ blocks: params: ratio: <> statements: - - main-write: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - main-write: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" diff --git a/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-timeseries.yaml b/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-timeseries.yaml index b7a4d9769..4abecb0a7 100644 --- a/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-timeseries.yaml +++ b/driver-http/src/main/resources/activities/graphql-schema-first/http-graphql-timeseries.yaml @@ -1,7 +1,6 @@ # nb -v run driver=http yaml=http-graphql-timeseries tags=phase:schema host=my_stargate_host stargate_host=my_stargate_host auth_token=$AUTH_TOKEN # TODO -# - /graphqlv2 will change in future, adapt when needed # - do we need a truncate schema / namespace at the end # - support for a paging state? # - infinity is not handled @@ -43,32 +42,32 @@ blocks: - tags: phase: schema statements: - - create-keyspace: POST <>://{weighted_hosts}:<><>/graphqlv2/admin + - create-keyspace: POST <>://{weighted_hosts}:<><>/graphql-schema Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | { - "query":"mutation {\n createNamespace(name: \"<>\", replicas: <>) {\n namespace {\n name\n }\n }\n}\n" + "query":"mutation {\n createKeyspace(name: \"<>\", replicas: <>, ifNotExists: true) \n}\n" } tags: name: create-keyspace - - create-gql-schema : POST <>://{weighted_hosts}:<><>/graphqlv2/admin + - create-gql-schema : POST <>://{weighted_hosts}:<><>/graphql-admin Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" Content-Type: "application/json" body: | { - "query":"mutation {\n deploySchema(namespace: \"<>\", schema: \"\"\"\n type Iot @cql_input {\n machine_id: Uuid! @cql_column(partitionKey: true)\n sensor_name: String! @cql_column(partitionKey: true)\n time: Timestamp! @cql_column(clusteringOrder: DESC)\n sensor_value: Float!\n \tstation_id: Uuid!\n data: String!\n }\n type SelectIotResult @cql_payload {\n \t\tdata: [Iot]\n \t\tpagingState: String\n }\n type Query {\n getIots(\n machine_id: Uuid!,\n sensor_name: String!,\n pagingState: String @cql_pagingState\n ): SelectIotResult @cql_select(pageSize: 10)\n }\n type Mutation {\n \t\tinsertIot(iot: IotInput): Iot\n }\n \"\"\") {\n version\n }\n}\n" + "query":"mutation {\n deploySchema(keyspace: \"<>\", schema: \"\"\"\n type Iot @cql_input {\n machine_id: Uuid! @cql_column(partitionKey: true)\n sensor_name: String! @cql_column(partitionKey: true)\n time: Timestamp! @cql_column(clusteringOrder: DESC)\n sensor_value: Float!\n \tstation_id: Uuid!\n data: String!\n }\n type SelectIotResult @cql_payload {\n \t\tdata: [Iot]\n \t\tpagingState: String\n }\n type Query {\n getIots(\n machine_id: Uuid!,\n sensor_name: String!,\n pagingState: String @cql_pagingState\n ): SelectIotResult @cql_select(pageSize: 10)\n }\n type Mutation {\n \t\tinsertIot(iot: IotInput): Iot\n }\n \"\"\") {\n version\n }\n}\n" } tags: name: create-gql-schema - tags: phase: schema-astra statements: - - create-gql-schema: POST <>://{weighted_hosts}:<><>/graphqlv2/admin + - create-gql-schema: POST <>://{weighted_hosts}:<><>/graphql-admin Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" @@ -83,7 +82,7 @@ blocks: tags: phase: rampup statements: - - rampup-insert: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - rampup-insert: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" @@ -102,7 +101,7 @@ blocks: params: ratio: <> statements: - - main-select: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - main-select: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>" @@ -121,7 +120,7 @@ blocks: params: ratio: <> statements: - - main-write: POST <>://{weighted_hosts}:<><>/graphqlv2/namespace/<> + - main-write: POST <>://{weighted_hosts}:<><>/graphql/<> Accept: "application/json" X-Cassandra-Request-Id: "{request_id}" X-Cassandra-Token: "<>"