{
  "openapi": "3.1.1",
  "info": {
    "title": "AppTest1 | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://apptest1.freshbit.se/"
    }
  ],
  "paths": {
    "/api/info": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Server, runtime and process information",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnonymousTypeOfstringAndstringAndstringAndstringAndstringAndstringAndstringAndintAndstringAndDateTimeOffsetAndstringAndDateTimeOffsetAndstringAnddoubleAnddoubleAndInt32[]Andint"
                }
              }
            }
          }
        }
      }
    },
    "/api/request": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "The request as the app sees it (client IP, scheme, Front Door headers)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnonymousTypeOfstringAndstringAndstringAndstringAndstringAndstringAndbooleanAndDictionaryOfstringAndstring"
                }
              }
            }
          }
        }
      }
    },
    "/api/external": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "The public APIs this app calls",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiDefinition"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/external/{id}": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Call one public API from the server (through the firewall)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fresh",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/infra": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Private DNS, TCP reachability inside the VNet, instance metadata",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": { }
              }
            }
          }
        }
      }
    },
    "/api/heartbeat": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Outbound checks the background service made, newest first",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Beat"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/primes": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "CPU work: count primes up to limit (max 100 000 000)",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnonymousTypeOfintAndintAndlong"
                }
              }
            }
          }
        }
      }
    },
    "/api/upload": {
      "post": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Upload test: returns size and SHA-256 of the body (max 100 MB)",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/download": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Download test: random bytes (max 50 MB)",
        "parameters": [
          {
            "name": "mb",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/delay": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Waits before answering (max 300 s), for timeout tests",
        "parameters": [
          {
            "name": "seconds",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnonymousTypeOfint"
                }
              }
            }
          }
        }
      }
    },
    "/api/status/{code}": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Answers with the given status code",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/echo": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Echoes q, for WAF tests",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnonymousTypeOfstringAndstring"
                }
              }
            }
          }
        }
      }
    },
    "/api/stream": {
      "get": {
        "tags": [
          "AppTest1"
        ],
        "summary": "Server-Sent Events: one tick a second",
        "parameters": [
          {
            "name": "seconds",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/event-stream": {
                "schema": {
                  "$ref": "#/components/schemas/SseItemOfObject"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AnonymousTypeOfint": {
        "required": [
          "waitedSeconds"
        ],
        "type": "object",
        "properties": {
          "waitedSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AnonymousTypeOfintAndintAndlong": {
        "required": [
          "limit",
          "primes",
          "elapsedMs"
        ],
        "type": "object",
        "properties": {
          "limit": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "primes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "elapsedMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "AnonymousTypeOfstringAndstring": {
        "required": [
          "q",
          "note"
        ],
        "type": "object",
        "properties": {
          "q": {
            "type": [
              "null",
              "string"
            ]
          },
          "note": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AnonymousTypeOfstringAndstringAndstringAndstringAndstringAndstringAndbooleanAndDictionaryOfstringAndstring": {
        "required": [
          "method",
          "scheme",
          "host",
          "path",
          "protocol",
          "clientIp",
          "viaFrontDoor",
          "headers"
        ],
        "type": "object",
        "properties": {
          "method": {
            "type": [
              "null",
              "string"
            ]
          },
          "scheme": {
            "type": [
              "null",
              "string"
            ]
          },
          "host": {
            "type": [
              "null",
              "string"
            ]
          },
          "path": {
            "type": [
              "null",
              "string"
            ]
          },
          "protocol": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientIp": {
            "type": [
              "null",
              "string"
            ]
          },
          "viaFrontDoor": {
            "type": "boolean"
          },
          "headers": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "AnonymousTypeOfstringAndstringAndstringAndstringAndstringAndstringAndstringAndintAndstringAndDateTimeOffsetAndstringAndDateTimeOffsetAndstringAnddoubleAnddoubleAndInt32[]Andint": {
        "required": [
          "app",
          "version",
          "environment",
          "machine",
          "os",
          "framework",
          "architecture",
          "cpus",
          "timeZone",
          "utcNow",
          "stockholmNow",
          "startedUtc",
          "uptime",
          "workingSetMb",
          "gcHeapMb",
          "gcCollections",
          "threads"
        ],
        "type": "object",
        "properties": {
          "app": {
            "type": [
              "null",
              "string"
            ]
          },
          "version": {
            "type": [
              "null",
              "string"
            ]
          },
          "environment": {
            "type": [
              "null",
              "string"
            ]
          },
          "machine": {
            "type": [
              "null",
              "string"
            ]
          },
          "os": {
            "type": [
              "null",
              "string"
            ]
          },
          "framework": {
            "type": [
              "null",
              "string"
            ]
          },
          "architecture": {
            "type": [
              "null",
              "string"
            ]
          },
          "cpus": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "timeZone": {
            "type": [
              "null",
              "string"
            ]
          },
          "utcNow": {
            "type": "string",
            "format": "date-time"
          },
          "stockholmNow": {
            "type": [
              "null",
              "string"
            ]
          },
          "startedUtc": {
            "type": "string",
            "format": "date-time"
          },
          "uptime": {
            "type": [
              "null",
              "string"
            ]
          },
          "workingSetMb": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "gcHeapMb": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "gcCollections": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          "threads": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ApiDefinition": {
        "required": [
          "id",
          "name",
          "host",
          "description"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "expectBlocked": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "Beat": {
        "required": [
          "at",
          "ok",
          "ip",
          "elapsedMs",
          "error"
        ],
        "type": "object",
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "ok": {
            "type": "boolean"
          },
          "ip": {
            "type": [
              "null",
              "string"
            ]
          },
          "elapsedMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SseItemOfObject": {
        "type": "object",
        "properties": {
          "data": { },
          "eventType": {
            "type": [
              "null",
              "string"
            ]
          },
          "eventId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reconnectionInterval": {
            "pattern": "^-?(\\d+\\.)?\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,7})?$",
            "type": [
              "null",
              "string"
            ]
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "AppTest1"
    }
  ]
}