Skip to content
This repository was archived by the owner on Feb 16, 2024. It is now read-only.

Conversation

@woonsan
Copy link

@woonsan woonsan commented Apr 8, 2019

As an initial PR, I've added swagger doc and UI support, and added API docs for the "admin" services for now; mutate and query services will come later.

How to test:

  1. Build the project with sbt package.

  2. Start the project in the target/apache-s2graph-0.2.1-SNAPSHOT-incubating-bin directory through bin/start-s2graph.sh command.

  3. Visit the Swagger UI at http://localhost:8000/api-docs/.

  4. Expand "/admin/createService" and click on "Try it out" button.
    Replace the body with the following and click on "Execute" button.

{
  "serviceName": "s2graph"
}

Check if the result is 201 with a JSON output and the status is "ok".

  1. "Try out" /admin/createLabel with body set to the following:
{
  "label": "user_article_liked",
  "srcServiceName": "s2graph",
  "srcColumnName": "user_id",
  "srcColumnType": "long",
  "tgtServiceName": "s2graph",
  "tgtColumnName": "article_id",
  "tgtColumnType": "string",
  "indices": [],
  "props": [],
  "serviceName": "s2graph"
}

Check if the result is 201 with a JSON output and the status is "ok".

  1. "Try out" /admin/createLabel with body set to the following:
{
  "label": "friends",
  "srcServiceName": "s2graph",
  "srcColumnName": "user_id",
  "srcColumnType": "long",
  "tgtServiceName": "s2graph",
  "tgtColumnName": "user_id",
  "tgtColumnType": "long",
  "indices": [
    {"name": "idx_affinity_timestamp", "propNames": ["affinity_score", "_timestamp"]}
  ],
  "props": [
    {"name": "affinity_score", "dataType": "float", "defaultValue": 0.0},
    {"name": "_timestamp", "dataType": "long", "defaultValue": 0},
    {"name": "is_hidden", "dataType": "boolean", "defaultValue": false},
    {"name": "is_blocked", "dataType": "boolean", "defaultValue": true},
    {"name": "error_code", "dataType": "integer", "defaultValue": 500}
  ],
  "serviceName": "s2graph",
  "consistencyLevel": "strong"
}

Check if the result is 201 with a JSON output and the status is "ok".

  1. "Try out" /admin/addIndex with body set to the following:
{
  "label": "friends",
  "indices": [
    {"name": "idx_3rd", "propNames": ["is_blocked", "_timestamp"]}
  ]
}

Check if the result is 201 with a JSON output and the status is "ok".

  1. "Try out" /admin/getLabel/{name} with name set to "friend".
    Check if the result is 200 with a JSON output.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant