Created
April 4, 2024 23:18
-
-
Save pvogel1967/92c9e3bbbc61f1165f1415d5e6d72557 to your computer and use it in GitHub Desktop.
OpenAPI spec with x-internal: true on some APIs
This file contains 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.0", | |
"paths": { | |
"/logging/sample_rate": { | |
"put": { | |
"operationId": "setSampleRate", | |
"summary": "Set sample rate for request tracker logs", | |
"description": "All error requests are tracked, successes are sampled with request start/end logged with details, this sets the sample rate as a percent of requests to log", | |
"parameters": [ | |
{ | |
"name": "ttl", | |
"required": false, | |
"in": "query", | |
"description": "time, in minutes, that the new sample rate should apply, default is 1 hour (60)", | |
"schema": {} | |
}, | |
{ | |
"name": "rate", | |
"required": true, | |
"in": "query", | |
"description": "the approximate % of requests to track as an integer between 0 and 100, inclusive", | |
"example": 15, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-feature-flags", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"default": "top-left,preferences-filter,new-music", | |
"description": "Comma-separated list of feature flags" | |
} | |
}, | |
{ | |
"name": "x-hydrow-tablet-serial-number", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-rower-id", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-tablet-generation", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-service-name", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/LogConfigVM" | |
} | |
} | |
} | |
} | |
}, | |
"tags": ["Internal User: Logging"], | |
"security": [ | |
{ | |
"internal-user": [] | |
} | |
] | |
} | |
}, | |
"/logging/global": { | |
"put": { | |
"operationId": "setGlobalLevels", | |
"x-internal": true, | |
"summary": "Set global logging level dynamically", | |
"description": "Used to set the log level that should apply to all requests with optional expiry to default levels", | |
"parameters": [ | |
{ | |
"name": "level", | |
"required": true, | |
"in": "query", | |
"description": "intended log level to apply for all requests processed after this request, one of: warn, info, debug", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"name": "ttl", | |
"required": false, | |
"in": "query", | |
"description": "time, in minutes, that the new log level should apply, default is 1 hour (60)", | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-feature-flags", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"default": "top-left,preferences-filter,new-music", | |
"description": "Comma-separated list of feature flags" | |
} | |
}, | |
{ | |
"name": "x-hydrow-tablet-serial-number", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-rower-id", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-tablet-generation", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-service-name", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/LogConfigVM" | |
} | |
} | |
} | |
} | |
}, | |
"tags": ["Internal User: Logging"], | |
"security": [ | |
{ | |
"internal-user": [] | |
} | |
] | |
} | |
}, | |
"/logging/route": { | |
"put": { | |
"operationId": "setRouteLevels", | |
"x-internal": true, | |
"summary": "Set logging level dynamically for a set of routes", | |
"description": "Used to set the log level that should apply to all requests on a given route with optional expiry to default levels", | |
"parameters": [ | |
{ | |
"name": "route", | |
"required": true, | |
"in": "query", | |
"description": "the route descriptor for which the log level should be changed", | |
"example": "/rower/:rowerId", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"name": "level", | |
"required": true, | |
"in": "query", | |
"description": "intended log level to apply for all requests processed after this request, one of: warn, info, debug", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"name": "ttl", | |
"required": false, | |
"in": "query", | |
"description": "time, in minutes, that the new log level should apply, default is 1 hour (60)", | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-feature-flags", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"default": "top-left,preferences-filter,new-music", | |
"description": "Comma-separated list of feature flags" | |
} | |
}, | |
{ | |
"name": "x-hydrow-tablet-serial-number", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-rower-id", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-tablet-generation", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-service-name", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/LogConfigVM" | |
} | |
} | |
} | |
} | |
}, | |
"tags": ["Internal User: Logging"], | |
"security": [ | |
{ | |
"internal-user": [] | |
} | |
] | |
} | |
}, | |
"/logging/rower/{rowerId}": { | |
"put": { | |
"operationId": "setRowerLevels", | |
"x-internal": true, | |
"summary": "Set logging level dynamically for a specific rowerId", | |
"description": "Used to set the log level that should apply to all requests from a given rowerId with optional expiry to default levels", | |
"parameters": [ | |
{ | |
"name": "level", | |
"required": true, | |
"in": "query", | |
"description": "intended log level to apply for all requests by clients on behalf of the given rowerId processed after this request, one of: warn, info, debug", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"name": "ttl", | |
"required": false, | |
"in": "query", | |
"description": "time, in minutes, that the new log level should apply, default is 1 hour (60)", | |
"schema": {} | |
}, | |
{ | |
"name": "rowerId", | |
"required": true, | |
"in": "path", | |
"description": "the rowerId for which the log level should be changed", | |
"example": "15973", | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-feature-flags", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"default": "top-left,preferences-filter,new-music", | |
"description": "Comma-separated list of feature flags" | |
} | |
}, | |
{ | |
"name": "x-hydrow-tablet-serial-number", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-rower-id", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-tablet-generation", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-service-name", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/LogConfigVM" | |
} | |
} | |
} | |
} | |
}, | |
"tags": ["Internal User: Logging"], | |
"security": [ | |
{ | |
"internal-user": [] | |
} | |
] | |
} | |
}, | |
"/logging/tablet/{tabletSn}": { | |
"put": { | |
"operationId": "setTabletLevels", | |
"summary": "Set logging level dynamically for a specific tablet", | |
"description": "Used to set the log level that should apply to all requests from a specified tablet with optional expiry to default levels", | |
"parameters": [ | |
{ | |
"name": "tabletSn", | |
"required": true, | |
"in": "path", | |
"description": "the Tablet Serial number for which the log level should be changed", | |
"example": "I22202047004491", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"name": "level", | |
"required": true, | |
"in": "query", | |
"description": "intended log level to apply for all requests by clients on behalf of the given tablet serial number processed after this request, one of: warn, info, debug", | |
"schema": { | |
"type": "string" | |
} | |
}, | |
{ | |
"name": "ttl", | |
"required": false, | |
"in": "query", | |
"description": "time, in minutes, that the new log level should apply, default is 1 hour (60)", | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-feature-flags", | |
"in": "header", | |
"required": false, | |
"schema": { | |
"type": "string", | |
"default": "top-left,preferences-filter,new-music", | |
"description": "Comma-separated list of feature flags" | |
} | |
}, | |
{ | |
"name": "x-hydrow-tablet-serial-number", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-rower-id", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-tablet-generation", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
}, | |
{ | |
"name": "x-hydrow-service-name", | |
"in": "header", | |
"required": false, | |
"schema": {} | |
} | |
], | |
"responses": { | |
"200": { | |
"description": "", | |
"content": { | |
"application/json": { | |
"schema": { | |
"$ref": "#/components/schemas/LogConfigVM" | |
} | |
} | |
} | |
} | |
}, | |
"tags": ["Internal User: Logging"], | |
"security": [ | |
{ | |
"internal-user": [] | |
} | |
] | |
} | |
} | |
}, | |
"info": { | |
"title": "Data API V2", | |
"description": "", | |
"version": "1.0.0", | |
"contact": {} | |
}, | |
"tags": [], | |
"servers": [], | |
"components": { | |
"securitySchemes": { | |
"idToken": { | |
"in": "header", | |
"name": "Authorization", | |
"description": "jwt", | |
"type": "apiKey" | |
}, | |
"bearer": { | |
"scheme": "bearer", | |
"bearerFormat": "JWT", | |
"type": "http" | |
}, | |
"internal-user": { | |
"in": "header", | |
"name": "x-hy-internal-user", | |
"description": "internal user auth", | |
"type": "apiKey" | |
}, | |
"internal-service": { | |
"in": "header", | |
"name": "x-hydrow-internal-services", | |
"description": "internal-service auth", | |
"type": "apiKey" | |
}, | |
"external-service": { | |
"in": "header", | |
"name": "x-hy-external-service", | |
"description": "external-service auth", | |
"type": "apiKey" | |
} | |
}, | |
"schemas": { | |
"LogConfigVM": { | |
"type": "object", | |
"properties": { | |
"globalLevel": { | |
"type": "string" | |
}, | |
"routeLevels": { | |
"type": "object", | |
"example": { | |
"/meta/ping-unlimited/:data": "debug" | |
} | |
}, | |
"rowerLevels": { | |
"type": "object", | |
"example": { | |
"15973": "debug" | |
} | |
}, | |
"tabletLevels": { | |
"type": "object", | |
"example": { | |
"I22202047004491": "debug" | |
} | |
}, | |
"sampleRate": { | |
"type": "number", | |
"example": 15 | |
} | |
}, | |
"required": ["globalLevel", "routeLevels", "rowerLevels", "tabletLevels", "sampleRate"] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment