openapi: "3.0.0"
info:
  title: "Trustlab"
  description: > 
    With Trustlab you can build security automation pipelines. Develop your services and expand your offer to your customers using our extensive, simple to use, APIs.
  version: "1.0"
paths:
  /api/v1/run/{service-name}:
    post:
      summary: "Run the service"
      description: "Run the service"
      parameters:
        - name: "service-name"
          description: "Service to run"
          in: "path"
          required: true
          schema:
            type: "string"
            example: "service-name-1"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: "object"
              example: { 
                "target": "demo.trustlab.it",
                "callback": "your.domain.it/getResults"
              }

      responses:
        "200":
          description: "Ok"
          content:
            application/json:
              schema:
                type: "object"
                example: 
                  {
                    "scanId": "b929a045-a643-402f-b292-601c6346ef22",
                    "results": "[...]"
                  }
        "500":
          description: "Error"


  /services:
    get:
      summary: "Get services"
      description: "Get available services"

      responses:
        "200":
          description: "Ok"
          content:
            application/json:
              schema:
                type: "object"
                example:
                  [
                    {
                      "service-name-1": "Service name description",
                      "price": 1,
                      "mode": "pay-per-run"
                    },
                    {
                      "service-name-2": "Service name description",
                      "price": 5,
                      "mode": "pay-per-results"
                    }
                  ]
        "500":
          description: "Error"

