Table Server

Table Server - Introduction

It is an API Service which holds all the API requests, which can be used to store the test data in table formats in a Database, which can be consumed/produced by both load test and synthetic monitoring tests. So it acts like a Test Data database where multiple scripts can consume common test data.

Currently, the Tests need Plugins to communicate with the Table Server API, but in near future we will come up with a solution where performance Engineers can write inline javascript in the test to communicate with the Table Server APIs.

Below are the API Requests that Table Server supports

  • Create a Table with the JSON input, an overwriteFlag flag will be optional here, if set to true, it will overwrite the existing table with the same name.
  curl -k --location --request POST 'https://{{tableserverURL}}:8084/Api' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "apiAuthToken": "{{apiAuthToken}}",
  "action": "createNewTable",
  "tableName": "Products",
  "columnNamesAndValues": [
        {
            "ProductGroup": "Icecream",   
            "ProductName": "Vanilla"
        },
        {
            "ProductGroup": "Pizza",   
            "ProductName": "Margareta"
        }
    ]
  }'
  • Create a Table with the CSV file data, an overwriteFlag flag will be optional here, if set to true, it will overwrite the existing table with the same name.
  curl -k --location --request POST 'https://{{tableserverURL}}:8084/Api' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "apiAuthToken": "{{apiAuthToken}}",
  "action": "createNewTableFromCSVFile",
  "uploadFileName": "Products.csv",
  "delimiter": ",",
  "uploadFileDataB64": "UHJvZHVjdEdyb3VwLFByb2R1Y3ROYW1lLFByaWNlDURyaW5rcyxDb2NhQ29sYSwxMApEcmlua3MsUGVwc2ksNwpEcmlua3MsN1VwLDgKRHJpbmtzLEZhbnRhLDkKUGl6emEsTWFyZ2FyZXRhLDEwDQ=="
  }'
  • Get All the Tables from Table Server with or without column details.
  curl -k --location --request POST 'https://{{tableserverURL}}:8084/Api' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "apiAuthToken": "{{apiAuthToken}}",
  "action": "getAllTables",
  "includeColumns": true
  }'
  • Create a single test data, can also pass an optional parameter “uniqueFlag” to 1, so that it will make sure that the column value is unique.
  curl -k --location --request POST 'https://{{tableserverURL}}:8084/Api' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "apiAuthToken": "{{apiAuthToken}}",
  "action": "insertColumn",
  "table": "Products",
  "column": "ProductGroup",
  "value": "Sweets"
  }'
  • Get a single test data, returns first row value for the given column and marks that as retrieved in the table. Supports an additional parameter rowIndex for getting the same value multiple times during the execution of the tests.
  curl -k --location --request POST 'https://{{tableserverURL}}:8084/Api' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "apiAuthToken": "{{apiAuthToken}}",
  "action": "retrieveColumn",
  "table": "Products",
  "column": "ProductName"
  }'
  • Update a single test data.

    curl -k --location --request POST 'https://{{tableserverURL}}:8084/Api' \
    --header 'Content-Type: application/json' \
    --data-raw '{
    "apiAuthToken": "{{apiAuthToken}}",
    "action": "updateColumn",
    "table": "Products",
    "column": "ProductGroup",
    "value": "Fruits",
    "rowIndex":1
    }'
    
  • Create multiple test data.

  curl -k --location --request POST 'https://{{tableserverURL}}:8084/Api' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "apiAuthToken": "{{apiAuthToken}}",
  "action": "insertRow",
  "table": "Products",
  "columnsAndValues": [
        {
            "ProductGroup": "Vegetables",      
            "ProductName": "Carrot"
        }
    ]
  }'
  • Get multiple test data, returns first row values for given columns and marks that as retrieved in the table. Supports an additional parameter rowIndex for getting the same value multiple times during the execution of the tests.
  curl --location --request POST 'https://{{tableserverURL}}:8084/Api' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "apiAuthToken": "{{apiAuthToken}}",
  "action": "retrieveRow",
  "table": "Products",
  "columns": [
            "ProductGroup",    
            "ProductName"
    ]
  }'
  • Query a table with column names and values, if not provided Column Names and Values, the entire table data will be retrieved.
  curl -k --location --request POST 'https://{{tableserverURL}}:8084/Api' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "apiAuthToken": "{{apiAuthToken}}",
  "action": "queryTable",
  "table": "Products",
  "columnNamesAndValues": [
        {
            "ProductGroup": "Vegetables",   
            "ProductName": "Carrot"
        }
    ]
  }'
  • Export a table as CSV file data.
 curl --location --request POST 'https://{{tableserverURL}}:8084/Api' \
 --header 'Content-Type: application/json' \
 --data-raw '{
 "apiAuthToken": "{{apiAuthToken}}",
 "action": "exportTableToCSV",
 "table": "Products"
 }'