Skip to content

Instantly share code, notes, and snippets.

@tbaums
Created August 16, 2023 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbaums/0bb73eda75c772bd553b4c12c4cb5665 to your computer and use it in GitHub Desktop.
Save tbaums/0bb73eda75c772bd553b4c12c4cb5665 to your computer and use it in GitHub Desktop.

Endpoints:

  1. Issue Token:

    • Endpoint: /api/tokens
    • Method: POST
    • Payload:
      {
        "client_id": "example-client-id"
      }
    • Response:
      {
        "id": "generated-token-id",
        "client_id": "example-client-id"
      }
  2. Provision Client:

    • Endpoint: /api/client
    • Method: POST
    • Note: Details not provided in the code. Example is based on typical behavior.
    • Payload:
      {
        "client_name": "example-client-name"
      }
    • Response:
      {
        "client_id": "generated-client-id",
        "client_name": "example-client-name"
      }
  3. Ingestion (Add Record):

    • Endpoint: /ingestion/:topic
    • Method: POST
    • Payload:
      {
        "origin": "example-origin",
        "data": "record-data-here"
      }
    • Response:
      {
        "status": "success",
        "message": "Record added successfully"
      }
  4. Fetch Record:

    • Endpoint: /ingestion/:topic/:offset
    • Method: GET
    • Response:
      {
        "id": "record-id",
        "origin": "example-origin",
        "data": "record-data-here"
      }
  5. Get Pipe Configs:

    • Endpoint: /pipe/configs
    • Method: GET
    • Response:
      {
        "configs": [
          {
            "id": 1,
            "pipe": {
              "section": "config-data"
            }
          }
        ]
      }
  6. Set Pipe Config:

    • Endpoint: /pipe/configs
    • Method: POST
    • Payload:
      {
        "configs": [
          {
            "id": 1,
            "pipe": {
              "section": "config-data"
            }
          }
        ]
      }
    • Response:
      {
        "status": "success",
        "message": "Configuration set successfully"
      }
  7. List All Clients:

    • Endpoint: /api/clients
    • Method: GET
    • Response:
      {
        "clients": [
          {
            "id": "example-client-id"
          }
        ]
      }
  8. Get UI Metadata:

    • Endpoint: /api/ui-metadata
    • Method: GET
    • Response:
      {
        "ui_metadata": {
          "key": "metadata-value"
        }
      }

Note: The payloads and responses are hypothetical and based on the provided Rust code's structure. The actual details might differ based on the full implementation and specific requirements.

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