Last active
March 10, 2026 15:20
-
-
Save tomkerkhove/9205200a9749a072250f966545510e78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "openapi": "3.0.1", | |
| "info": { | |
| "title": "Performance Testing API", | |
| "description": "High-performance mock backend for Azure API Management performance testing. Includes legacy benchmark endpoints and configurable /perf endpoints covering top real-world API traffic patterns.", | |
| "version": "2.0" | |
| }, | |
| "servers": [ | |
| { | |
| "url": "http://godzilla.performance.test.int-azure-api.net/" | |
| }, | |
| { | |
| "url": "https://godzilla.performance.test.int-azure-api.net/" | |
| } | |
| ], | |
| "tags": [ | |
| { | |
| "name": "legacy", | |
| "description": "Existing endpoints (/json, /plaintext, /aoai)" | |
| }, | |
| { | |
| "name": "perf", | |
| "description": "/perf endpoints for APIM performance testing" | |
| }, | |
| { | |
| "name": "perf-streaming", | |
| "description": "SSE and chunked streaming endpoints" | |
| }, | |
| { | |
| "name": "perf-ai", | |
| "description": "AOAI completion endpoint" | |
| }, | |
| { | |
| "name": "perf-security", | |
| "description": "mTLS and trailers endpoints" | |
| } | |
| ], | |
| "paths": { | |
| "/plaintext": { | |
| "get": { | |
| "summary": "Get plain text response", | |
| "description": "Get plain text response", | |
| "operationId": "plaintext-default", | |
| "parameters": [], | |
| "responses": { | |
| "200": { | |
| "description": "Returned in all cases.", | |
| "content": { | |
| "text/plain": { | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/plaintext/{size}": { | |
| "get": { | |
| "summary": "Get plain text response for given size", | |
| "description": "Get plain text response for given size", | |
| "operationId": "plaintext-custom", | |
| "parameters": [ | |
| { | |
| "name": "size", | |
| "in": "path", | |
| "required": true, | |
| "schema": { | |
| "type": "integer", | |
| "enum": [ | |
| 512, | |
| 131072, | |
| 1048576 | |
| ] | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Returned in all cases.", | |
| "content": { | |
| "text/plain": { | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/json": { | |
| "get": { | |
| "summary": "Get JSON payload response", | |
| "description": "Get JSON payload response", | |
| "operationId": "json", | |
| "parameters": [], | |
| "responses": { | |
| "200": { | |
| "description": "Returned in all cases.", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/aoai/chat-completion": { | |
| "post": { | |
| "summary": "Simulate chat completion for Azure OpenAI", | |
| "description": "Get simulated chat completion response from Azure OpenAI", | |
| "operationId": "aoai-chat-completion", | |
| "requestBody": { | |
| "required": true, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "type": "object" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Returned in all cases.", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/health": { | |
| "get": { | |
| "operationId": "getPerfHealth", | |
| "summary": "Health check for the perf backend", | |
| "description": "Returns a simple JSON health status. Used to verify the backend is alive before running perf tests. Sets the X-Protocol-Version response header.", | |
| "tags": [ | |
| "perf" | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Healthy status", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/PerfHealthResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/rest": { | |
| "get": { | |
| "operationId": "getPerfRest", | |
| "summary": "Configurable JSON REST response", | |
| "description": "Returns a JSON response padded to the requested byte size. Tests APIM pass-through of typical REST API JSON responses with configurable payload size, artificial delay, and custom status codes.", | |
| "tags": [ | |
| "perf" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "size", | |
| "in": "query", | |
| "required": false, | |
| "description": "Target response body size in bytes. The JSON envelope overhead is subtracted and the 'data' field is padded to reach the target size.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 1024, | |
| "minimum": 0, | |
| "maximum": 10485760 | |
| } | |
| }, | |
| { | |
| "$ref": "#/components/parameters/delay" | |
| }, | |
| { | |
| "$ref": "#/components/parameters/status" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Padded JSON REST response", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/PerfRestResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/sse": { | |
| "get": { | |
| "operationId": "getPerfSse", | |
| "summary": "Server-Sent Events stream", | |
| "description": "Streams a configurable number of SSE events with optional inter-event delays. Tests APIM handling of long-lived text/event-stream connections, buffering behavior, and streaming proxy support. When stream=false all events are buffered and flushed at once.", | |
| "tags": [ | |
| "perf-streaming" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "events", | |
| "in": "query", | |
| "required": false, | |
| "description": "Number of SSE events to emit.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 20, | |
| "minimum": 0, | |
| "maximum": 10000 | |
| } | |
| }, | |
| { | |
| "name": "interval", | |
| "in": "query", | |
| "required": false, | |
| "description": "Delay in milliseconds between events (only when stream=true).", | |
| "schema": { | |
| "type": "integer", | |
| "default": 100, | |
| "minimum": 0, | |
| "maximum": 60000 | |
| } | |
| }, | |
| { | |
| "name": "eventSize", | |
| "in": "query", | |
| "required": false, | |
| "description": "Size in bytes of the payload string in each event.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 256, | |
| "minimum": 0, | |
| "maximum": 65536 | |
| } | |
| }, | |
| { | |
| "name": "stream", | |
| "in": "query", | |
| "required": false, | |
| "description": "When true (default), events are flushed individually with inter-event delays. When false, all events are buffered and flushed at the end.", | |
| "schema": { | |
| "type": "boolean", | |
| "default": true | |
| } | |
| }, | |
| { | |
| "$ref": "#/components/parameters/delay" | |
| }, | |
| { | |
| "$ref": "#/components/parameters/status" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "SSE event stream. Each event has the format: id, event: message, data: JSON with seq and payload fields.", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| }, | |
| "Cache-Control": { | |
| "schema": { | |
| "type": "string", | |
| "example": "no-cache" | |
| } | |
| } | |
| }, | |
| "content": { | |
| "text/event-stream": { | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/chunked": { | |
| "get": { | |
| "operationId": "getPerfChunked", | |
| "summary": "Chunked binary transfer", | |
| "description": "Sends a configurable number of random binary chunks with optional inter-chunk delays. Tests APIM handling of chunked transfer-encoding, streaming binary payloads, and backpressure. Total size (chunks * chunkSize) must not exceed 10 MB.", | |
| "tags": [ | |
| "perf-streaming" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "chunks", | |
| "in": "query", | |
| "required": false, | |
| "description": "Number of chunks to send.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 16, | |
| "minimum": 0, | |
| "maximum": 1024 | |
| } | |
| }, | |
| { | |
| "name": "chunkSize", | |
| "in": "query", | |
| "required": false, | |
| "description": "Size of each chunk in bytes.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 65536, | |
| "minimum": 0, | |
| "maximum": 1048576 | |
| } | |
| }, | |
| { | |
| "name": "interval", | |
| "in": "query", | |
| "required": false, | |
| "description": "Delay in milliseconds between chunks.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 0, | |
| "minimum": 0, | |
| "maximum": 60000 | |
| } | |
| }, | |
| { | |
| "$ref": "#/components/parameters/delay" | |
| }, | |
| { | |
| "$ref": "#/components/parameters/status" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Chunked binary stream of random data", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| } | |
| }, | |
| "content": { | |
| "application/octet-stream": { | |
| "schema": { | |
| "type": "string", | |
| "format": "binary" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error (including chunks*chunkSize > 10MB)", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/upload": { | |
| "post": { | |
| "operationId": "postPerfUpload", | |
| "summary": "Upload body consumer", | |
| "description": "Reads the entire request body and returns the byte count, elapsed time, and optionally a SHA-256 hash of the payload. Tests APIM handling of large request bodies, upload streaming, and request buffering. Maximum upload size is 100 MB.", | |
| "tags": [ | |
| "perf" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "echo", | |
| "in": "query", | |
| "required": false, | |
| "description": "When true, computes and returns a SHA-256 hash of the uploaded body.", | |
| "schema": { | |
| "type": "boolean", | |
| "default": false | |
| } | |
| }, | |
| { | |
| "$ref": "#/components/parameters/delay" | |
| }, | |
| { | |
| "$ref": "#/components/parameters/status" | |
| } | |
| ], | |
| "requestBody": { | |
| "required": true, | |
| "description": "Arbitrary binary payload to upload (max 100 MB).", | |
| "content": { | |
| "application/octet-stream": { | |
| "schema": { | |
| "type": "string", | |
| "format": "binary" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "Upload result with byte count and optional hash", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/PerfUploadResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "413": { | |
| "description": "Request body exceeds 100 MB limit", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/aoai/completions": { | |
| "post": { | |
| "operationId": "postPerfAoaiCompletions", | |
| "summary": "Mock Azure OpenAI chat completions", | |
| "description": "Simulates an Azure OpenAI chat completions endpoint with configurable token count, streaming behavior, and inter-token delay. Supports both non-streaming (full JSON) and streaming (SSE) response modes. Tests APIM handling of AI/LLM traffic patterns including token-by-token streaming.", | |
| "tags": [ | |
| "perf-ai" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "tokens", | |
| "in": "query", | |
| "required": false, | |
| "description": "Number of completion tokens to generate. Each token produces 4 characters of content.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 50, | |
| "minimum": 0, | |
| "maximum": 5000 | |
| } | |
| }, | |
| { | |
| "name": "tokenInterval", | |
| "in": "query", | |
| "required": false, | |
| "description": "Delay in milliseconds between streamed tokens (only when stream=true).", | |
| "schema": { | |
| "type": "integer", | |
| "default": 80, | |
| "minimum": 0, | |
| "maximum": 5000 | |
| } | |
| }, | |
| { | |
| "name": "stream", | |
| "in": "query", | |
| "required": false, | |
| "description": "When true (default), response is streamed as SSE events. When false, returns a single JSON response.", | |
| "schema": { | |
| "type": "boolean", | |
| "default": true | |
| } | |
| }, | |
| { | |
| "name": "promptTokens", | |
| "in": "query", | |
| "required": false, | |
| "description": "Number of prompt tokens to report in the usage object.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 100, | |
| "minimum": 0, | |
| "maximum": 100000 | |
| } | |
| }, | |
| { | |
| "name": "model", | |
| "in": "query", | |
| "required": false, | |
| "description": "Model identifier to include in the response.", | |
| "schema": { | |
| "type": "string", | |
| "default": "gpt-4o", | |
| "enum": [ | |
| "gpt-4o", | |
| "gpt-4", | |
| "gpt-35-turbo", | |
| "gpt-4o-mini" | |
| ] | |
| } | |
| }, | |
| { | |
| "$ref": "#/components/parameters/delay" | |
| }, | |
| { | |
| "$ref": "#/components/parameters/status" | |
| } | |
| ], | |
| "requestBody": { | |
| "required": false, | |
| "description": "Optional AOAI-style request body. The body is consumed but not parsed.", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "type": "object" | |
| } | |
| } | |
| } | |
| }, | |
| "responses": { | |
| "200": { | |
| "description": "AOAI completion response. Content type depends on the stream parameter.", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/PerfAoaiCompletionResponse" | |
| } | |
| }, | |
| "text/event-stream": { | |
| "schema": { | |
| "type": "string", | |
| "description": "SSE stream of chat.completion.chunk objects, followed by a final chunk with finish_reason 'stop' and usage, then 'data: [DONE]'." | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/delayed": { | |
| "get": { | |
| "operationId": "getPerfDelayed", | |
| "summary": "Configurable delayed response", | |
| "description": "Waits for a configurable delay (with optional random jitter) before returning a JSON response with the actual wait time. Tests APIM timeout handling, connection pooling under slow backends, and retry behavior. Note: this endpoint handles delay/status directly and does not use the common delay/status parameters.", | |
| "tags": [ | |
| "perf" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "delay", | |
| "in": "query", | |
| "required": false, | |
| "description": "Base delay in milliseconds before responding.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 5000, | |
| "minimum": 0, | |
| "maximum": 120000 | |
| } | |
| }, | |
| { | |
| "name": "jitter", | |
| "in": "query", | |
| "required": false, | |
| "description": "Maximum random jitter in milliseconds added to or subtracted from the delay. Must be <= delay.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 0, | |
| "minimum": 0, | |
| "maximum": 120000 | |
| } | |
| }, | |
| { | |
| "name": "status", | |
| "in": "query", | |
| "required": false, | |
| "description": "HTTP status code to return.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 200, | |
| "minimum": 100, | |
| "maximum": 599 | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Delayed response with actual wait time", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/PerfDelayedResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error (e.g. jitter > delay)", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/compressed": { | |
| "get": { | |
| "operationId": "getPerfCompressed", | |
| "summary": "Compressed JSON response", | |
| "description": "Returns a JSON payload compressed with the specified encoding (gzip, deflate, or brotli). The uncompressed payload is a JSON object with a repetitive data field padded to the requested size. Tests APIM handling of Content-Encoding headers, decompression, and compressed payload forwarding.", | |
| "tags": [ | |
| "perf" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "size", | |
| "in": "query", | |
| "required": false, | |
| "description": "Size in bytes of the uncompressed data field in the JSON payload.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 8192, | |
| "minimum": 0, | |
| "maximum": 10485760 | |
| } | |
| }, | |
| { | |
| "name": "encoding", | |
| "in": "query", | |
| "required": false, | |
| "description": "Compression encoding to apply to the response body.", | |
| "schema": { | |
| "type": "string", | |
| "default": "gzip", | |
| "enum": [ | |
| "gzip", | |
| "deflate", | |
| "br" | |
| ] | |
| } | |
| }, | |
| { | |
| "$ref": "#/components/parameters/delay" | |
| }, | |
| { | |
| "$ref": "#/components/parameters/status" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Compressed JSON response with Content-Encoding header", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| }, | |
| "Content-Encoding": { | |
| "schema": { | |
| "type": "string", | |
| "enum": [ | |
| "gzip", | |
| "deflate", | |
| "br" | |
| ] | |
| }, | |
| "description": "The compression encoding applied to the response body." | |
| }, | |
| "Vary": { | |
| "schema": { | |
| "type": "string", | |
| "example": "Accept-Encoding" | |
| } | |
| } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/PerfCompressedResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/mtls-echo": { | |
| "get": { | |
| "operationId": "getPerfMtlsEcho", | |
| "summary": "Echo client certificate details", | |
| "description": "Returns details of the client TLS certificate if one was presented, or indicates no certificate was provided. Tests APIM mTLS client certificate forwarding and mutual TLS authentication scenarios.", | |
| "tags": [ | |
| "perf-security" | |
| ], | |
| "parameters": [ | |
| { | |
| "$ref": "#/components/parameters/delay" | |
| }, | |
| { | |
| "$ref": "#/components/parameters/status" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Client certificate details (or hasCert=false if none provided)", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/PerfMtlsResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/multiplex": { | |
| "get": { | |
| "operationId": "getPerfMultiplex", | |
| "summary": "HTTP/2 multiplexing test", | |
| "description": "Returns connection and request metadata after an optional delay. Used to verify HTTP/2 multiplexing by sending many concurrent requests and confirming they share a single connectionId. Tests APIM HTTP/2 backend connection reuse and multiplexing support.", | |
| "tags": [ | |
| "perf" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "delay", | |
| "in": "query", | |
| "required": false, | |
| "description": "Delay in milliseconds before responding.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 100, | |
| "minimum": 0, | |
| "maximum": 120000 | |
| } | |
| }, | |
| { | |
| "name": "status", | |
| "in": "query", | |
| "required": false, | |
| "description": "HTTP status code to return.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 200, | |
| "minimum": 100, | |
| "maximum": 599 | |
| } | |
| }, | |
| { | |
| "name": "id", | |
| "in": "query", | |
| "required": false, | |
| "description": "Optional request identifier. If not provided, a new GUID is generated.", | |
| "schema": { | |
| "type": "string" | |
| } | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Multiplex response with connection and timing metadata", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| } | |
| }, | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/PerfMultiplexResponse" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "/perf/trailers": { | |
| "get": { | |
| "operationId": "getPerfTrailers", | |
| "summary": "HTTP trailers with binary body", | |
| "description": "Sends a random binary body followed by HTTP trailers containing a SHA-256 checksum (X-Checksum) and body length (X-Body-Length). If the connection does not support trailers, the X-Trailers-Supported: false header is set instead. Tests APIM handling of HTTP/2 trailers and post-body metadata.", | |
| "tags": [ | |
| "perf-security" | |
| ], | |
| "parameters": [ | |
| { | |
| "name": "size", | |
| "in": "query", | |
| "required": false, | |
| "description": "Size in bytes of the random binary body.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 4096, | |
| "minimum": 0, | |
| "maximum": 10485760 | |
| } | |
| }, | |
| { | |
| "$ref": "#/components/parameters/delay" | |
| }, | |
| { | |
| "$ref": "#/components/parameters/status" | |
| } | |
| ], | |
| "responses": { | |
| "200": { | |
| "description": "Random binary body with optional HTTP trailers", | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "$ref": "#/components/headers/X-Protocol-Version" | |
| }, | |
| "X-Trailers-Supported": { | |
| "schema": { | |
| "type": "string" | |
| }, | |
| "description": "Set to 'false' when the connection does not support trailers." | |
| }, | |
| "Trailer": { | |
| "schema": { | |
| "type": "string", | |
| "example": "X-Checksum, X-Body-Length" | |
| }, | |
| "description": "Declared trailers (X-Checksum, X-Body-Length) when trailers are supported." | |
| } | |
| }, | |
| "content": { | |
| "application/octet-stream": { | |
| "schema": { | |
| "type": "string", | |
| "format": "binary" | |
| } | |
| } | |
| } | |
| }, | |
| "400": { | |
| "description": "Parameter validation error", | |
| "content": { | |
| "application/json": { | |
| "schema": { | |
| "$ref": "#/components/schemas/ErrorResponse" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "components": { | |
| "securitySchemes": { | |
| "apiKeyHeader": { | |
| "type": "apiKey", | |
| "name": "Ocp-Apim-Subscription-Key", | |
| "in": "header" | |
| }, | |
| "apiKeyQuery": { | |
| "type": "apiKey", | |
| "name": "subscription-key", | |
| "in": "query" | |
| } | |
| }, | |
| "headers": { | |
| "X-Protocol-Version": { | |
| "description": "The HTTP protocol version used for the request (e.g. HTTP/1.1, HTTP/2).", | |
| "schema": { | |
| "type": "string", | |
| "example": "HTTP/2" | |
| } | |
| } | |
| }, | |
| "parameters": { | |
| "delay": { | |
| "name": "delay", | |
| "in": "query", | |
| "required": false, | |
| "description": "Artificial delay in milliseconds before the response is sent.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 0, | |
| "minimum": 0, | |
| "maximum": 120000 | |
| } | |
| }, | |
| "status": { | |
| "name": "status", | |
| "in": "query", | |
| "required": false, | |
| "description": "HTTP status code to return in the response.", | |
| "schema": { | |
| "type": "integer", | |
| "default": 200, | |
| "minimum": 100, | |
| "maximum": 599 | |
| } | |
| } | |
| }, | |
| "schemas": { | |
| "JsonMessage": { | |
| "type": "object", | |
| "properties": { | |
| "message": { | |
| "type": "string", | |
| "example": "Hello, World!" | |
| } | |
| }, | |
| "required": [ | |
| "message" | |
| ] | |
| }, | |
| "AoaiChatCompletionRequest": { | |
| "type": "object", | |
| "description": "Request body for the legacy AOAI chat-completion endpoint. The body is consumed but the format is flexible.", | |
| "properties": { | |
| "model": { | |
| "type": "string", | |
| "example": "gpt-4o" | |
| }, | |
| "temperature": { | |
| "type": "number", | |
| "example": 0.97 | |
| }, | |
| "top_p": { | |
| "type": "number", | |
| "example": 0.95 | |
| }, | |
| "max_tokens": { | |
| "type": "integer", | |
| "example": 800 | |
| }, | |
| "stream": { | |
| "type": "boolean", | |
| "example": true | |
| }, | |
| "messages": { | |
| "type": "array", | |
| "items": { | |
| "type": "object", | |
| "properties": { | |
| "role": { | |
| "type": "string", | |
| "example": "user" | |
| }, | |
| "content": { | |
| "type": "array", | |
| "items": { | |
| "type": "object", | |
| "properties": { | |
| "type": { | |
| "type": "string", | |
| "example": "text" | |
| }, | |
| "text": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "AoaiResponseMessage": { | |
| "type": "object", | |
| "description": "Pre-generated AOAI-style response message echoed by the legacy /aoai/chat-completion endpoint.", | |
| "properties": { | |
| "model": { | |
| "type": "string", | |
| "example": "gpt-4o" | |
| }, | |
| "temperature": { | |
| "type": "number" | |
| }, | |
| "top_p": { | |
| "type": "number" | |
| }, | |
| "max_tokens": { | |
| "type": "integer" | |
| }, | |
| "stream": { | |
| "type": "boolean" | |
| }, | |
| "messages": { | |
| "type": "array", | |
| "items": { | |
| "type": "object", | |
| "properties": { | |
| "role": { | |
| "type": "string" | |
| }, | |
| "content": { | |
| "type": "array", | |
| "items": { | |
| "type": "object", | |
| "properties": { | |
| "type": { | |
| "type": "string" | |
| }, | |
| "text": { | |
| "type": "string" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "PerfHealthResponse": { | |
| "type": "object", | |
| "properties": { | |
| "status": { | |
| "type": "string", | |
| "example": "healthy" | |
| } | |
| }, | |
| "required": [ | |
| "status" | |
| ] | |
| }, | |
| "PerfRestResponse": { | |
| "type": "object", | |
| "properties": { | |
| "id": { | |
| "type": "string", | |
| "format": "uuid", | |
| "description": "Unique identifier for this response." | |
| }, | |
| "timestamp": { | |
| "type": "string", | |
| "format": "date-time", | |
| "description": "UTC timestamp when the response was generated." | |
| }, | |
| "status": { | |
| "type": "string", | |
| "description": "Always 'ok'.", | |
| "example": "ok" | |
| }, | |
| "data": { | |
| "type": "string", | |
| "description": "Padding data to reach the target response size." | |
| } | |
| }, | |
| "required": [ | |
| "id", | |
| "timestamp", | |
| "status", | |
| "data" | |
| ] | |
| }, | |
| "PerfUploadResponse": { | |
| "type": "object", | |
| "properties": { | |
| "bytesReceived": { | |
| "type": "integer", | |
| "format": "int64", | |
| "description": "Total number of bytes received from the request body." | |
| }, | |
| "hash": { | |
| "type": "string", | |
| "nullable": true, | |
| "description": "Lowercase hex-encoded SHA-256 hash of the uploaded body. Null when echo=false." | |
| }, | |
| "durationMs": { | |
| "type": "integer", | |
| "format": "int64", | |
| "description": "Time in milliseconds to read the entire request body." | |
| } | |
| }, | |
| "required": [ | |
| "bytesReceived", | |
| "durationMs" | |
| ] | |
| }, | |
| "PerfAoaiCompletionResponse": { | |
| "type": "object", | |
| "description": "Non-streaming AOAI chat completion response (when stream=false).", | |
| "properties": { | |
| "id": { | |
| "type": "string", | |
| "description": "Unique completion identifier (chatcmpl-<guid>).", | |
| "example": "chatcmpl-abc123" | |
| }, | |
| "object": { | |
| "type": "string", | |
| "description": "Object type.", | |
| "example": "chat.completion" | |
| }, | |
| "created": { | |
| "type": "integer", | |
| "format": "int64", | |
| "description": "Unix timestamp of when the completion was created." | |
| }, | |
| "model": { | |
| "type": "string", | |
| "description": "Model identifier used.", | |
| "example": "gpt-4o" | |
| }, | |
| "choices": { | |
| "type": "array", | |
| "items": { | |
| "$ref": "#/components/schemas/PerfAoaiChoice" | |
| } | |
| }, | |
| "usage": { | |
| "$ref": "#/components/schemas/PerfAoaiUsage" | |
| } | |
| }, | |
| "required": [ | |
| "id", | |
| "object", | |
| "created", | |
| "model", | |
| "choices", | |
| "usage" | |
| ] | |
| }, | |
| "PerfAoaiChoice": { | |
| "type": "object", | |
| "properties": { | |
| "index": { | |
| "type": "integer", | |
| "description": "Index of this choice." | |
| }, | |
| "message": { | |
| "$ref": "#/components/schemas/PerfAoaiMessage" | |
| }, | |
| "finishReason": { | |
| "type": "string", | |
| "description": "Reason the completion stopped.", | |
| "example": "stop" | |
| } | |
| }, | |
| "required": [ | |
| "index", | |
| "message", | |
| "finishReason" | |
| ] | |
| }, | |
| "PerfAoaiMessage": { | |
| "type": "object", | |
| "properties": { | |
| "role": { | |
| "type": "string", | |
| "description": "Message role.", | |
| "example": "assistant" | |
| }, | |
| "content": { | |
| "type": "string", | |
| "description": "Generated content text." | |
| } | |
| }, | |
| "required": [ | |
| "role", | |
| "content" | |
| ] | |
| }, | |
| "PerfAoaiUsage": { | |
| "type": "object", | |
| "properties": { | |
| "promptTokens": { | |
| "type": "integer", | |
| "description": "Number of tokens in the prompt." | |
| }, | |
| "completionTokens": { | |
| "type": "integer", | |
| "description": "Number of tokens in the completion." | |
| }, | |
| "totalTokens": { | |
| "type": "integer", | |
| "description": "Total tokens (prompt + completion)." | |
| } | |
| }, | |
| "required": [ | |
| "promptTokens", | |
| "completionTokens", | |
| "totalTokens" | |
| ] | |
| }, | |
| "PerfDelayedResponse": { | |
| "type": "object", | |
| "properties": { | |
| "waited": { | |
| "type": "integer", | |
| "format": "int64", | |
| "description": "Actual milliseconds waited (may differ from requested delay due to jitter and system timing)." | |
| }, | |
| "timestamp": { | |
| "type": "string", | |
| "format": "date-time", | |
| "description": "UTC timestamp after the delay completed." | |
| } | |
| }, | |
| "required": [ | |
| "waited", | |
| "timestamp" | |
| ] | |
| }, | |
| "PerfCompressedResponse": { | |
| "type": "object", | |
| "description": "The JSON payload before compression. The actual response body is compressed per the Content-Encoding header.", | |
| "properties": { | |
| "data": { | |
| "type": "string", | |
| "description": "Repetitive padding data of the requested size." | |
| } | |
| }, | |
| "required": [ | |
| "data" | |
| ] | |
| }, | |
| "PerfMtlsResponse": { | |
| "type": "object", | |
| "properties": { | |
| "hasCert": { | |
| "type": "boolean", | |
| "description": "Whether a client certificate was presented." | |
| }, | |
| "subject": { | |
| "type": "string", | |
| "nullable": true, | |
| "description": "Certificate subject distinguished name." | |
| }, | |
| "issuer": { | |
| "type": "string", | |
| "nullable": true, | |
| "description": "Certificate issuer distinguished name." | |
| }, | |
| "thumbprint": { | |
| "type": "string", | |
| "nullable": true, | |
| "description": "Certificate SHA-1 thumbprint." | |
| }, | |
| "notAfter": { | |
| "type": "string", | |
| "nullable": true, | |
| "description": "Certificate expiration date in ISO 8601 format." | |
| }, | |
| "serialNumber": { | |
| "type": "string", | |
| "nullable": true, | |
| "description": "Certificate serial number." | |
| } | |
| }, | |
| "required": [ | |
| "hasCert" | |
| ] | |
| }, | |
| "PerfMultiplexResponse": { | |
| "type": "object", | |
| "properties": { | |
| "requestId": { | |
| "type": "string", | |
| "description": "The request identifier (from the 'id' query parameter or auto-generated GUID)." | |
| }, | |
| "connectionId": { | |
| "type": "string", | |
| "description": "Server-side connection identifier. Identical values across requests indicate HTTP/2 multiplexing on a single connection." | |
| }, | |
| "protocol": { | |
| "type": "string", | |
| "description": "HTTP protocol version used (e.g. HTTP/1.1, HTTP/2)." | |
| }, | |
| "startedAt": { | |
| "type": "string", | |
| "format": "date-time", | |
| "description": "UTC timestamp when the request started processing." | |
| }, | |
| "completedAt": { | |
| "type": "string", | |
| "format": "date-time", | |
| "description": "UTC timestamp when the response was ready (after delay)." | |
| }, | |
| "delayMs": { | |
| "type": "integer", | |
| "description": "Configured delay in milliseconds." | |
| } | |
| }, | |
| "required": [ | |
| "requestId", | |
| "connectionId", | |
| "protocol", | |
| "startedAt", | |
| "completedAt", | |
| "delayMs" | |
| ] | |
| }, | |
| "ErrorResponse": { | |
| "type": "object", | |
| "properties": { | |
| "error": { | |
| "type": "string", | |
| "description": "Human-readable error message describing the validation failure." | |
| } | |
| }, | |
| "required": [ | |
| "error" | |
| ] | |
| } | |
| } | |
| }, | |
| "security": [ | |
| { | |
| "apiKeyHeader": [] | |
| }, | |
| { | |
| "apiKeyQuery": [] | |
| } | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment