-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathopenapi.json
More file actions
1 lines (1 loc) · 11.1 KB
/
openapi.json
File metadata and controls
1 lines (1 loc) · 11.1 KB
1
{"openapi": "3.0.2", "info": {"title": "MRT Data Parsing API", "description": "\nBGPKIT Parsing API provides BGP MRT data searching and parsing functionalities via RESTful API.\n", "version": "0.1.0"}, "paths": {"/parse": {"get": {"summary": "Parse Single File", "description": "The `/parse` endpoint provides parsing functionality for one single MRT file.", "operationId": "parse_single_file_parse_get", "parameters": [{"description": "URL to the MRT file to parse", "required": true, "schema": {"title": "Url", "type": "string", "description": "URL to the MRT file to parse"}, "name": "url", "in": "query"}, {"description": "filter by prefix", "required": false, "schema": {"title": "Prefix", "type": "string", "description": "filter by prefix"}, "name": "prefix", "in": "query"}, {"description": "whether to include super prefix", "required": false, "schema": {"title": "Include Super", "type": "boolean", "description": "whether to include super prefix", "default": false}, "name": "include_super", "in": "query"}, {"description": "whether to include sub prefix", "required": false, "schema": {"title": "Include Sub", "type": "boolean", "description": "whether to include sub prefix", "default": false}, "name": "include_sub", "in": "query"}, {"description": "filter by AS number", "required": false, "schema": {"title": "Asn", "type": "integer", "description": "filter by AS number"}, "name": "asn", "in": "query"}, {"description": "filter by AS path", "required": false, "schema": {"title": "As Path", "type": "string", "description": "filter by AS path"}, "name": "as_path", "in": "query"}, {"description": "filter by collector peer IP address", "required": false, "schema": {"title": "Peer Ip", "type": "string", "description": "filter by collector peer IP address"}, "name": "peer_ip", "in": "query"}, {"description": "filter by collector peer IP ASN", "required": false, "schema": {"title": "Peer Asn", "type": "string", "description": "filter by collector peer IP ASN"}, "name": "peer_asn", "in": "query"}, {"description": "message type, announcement or withdrawal", "required": false, "schema": {"title": "Msg Type", "type": "string", "description": "message type, announcement or withdrawal"}, "name": "msg_type", "in": "query"}, {"description": "limit the number of messages to return", "required": false, "schema": {"title": "Limit", "type": "integer", "description": "limit the number of messages to return"}, "name": "limit", "in": "query"}], "responses": {"200": {"description": "Parsed API", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ParseResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/files": {"get": {"summary": "Search Files", "description": "The `/files` endpoint provides searching for MRT files from RIPE RIS and RouteViews collectors.", "operationId": "search_files_files_get", "parameters": [{"description": "start timestamp, in unix time or RFC3339 format", "required": true, "schema": {"title": "Ts Start", "type": "string", "description": "start timestamp, in unix time or RFC3339 format"}, "name": "ts_start", "in": "query"}, {"description": "end timestamp, in unix time or RFC3339 format", "required": true, "schema": {"title": "Ts End", "type": "string", "description": "end timestamp, in unix time or RFC3339 format"}, "name": "ts_end", "in": "query"}, {"description": "filter by project name, i.e. route-views or riperis", "required": false, "schema": {"title": "Project", "type": "string", "description": "filter by project name, i.e. route-views or riperis"}, "name": "project", "in": "query"}, {"description": "filter by collector name, e.g. rrc00 or route-views2. use comma to separate multiple collectors.", "required": false, "schema": {"title": "Collector", "type": "string", "description": "filter by collector name, e.g. rrc00 or route-views2. use comma to separate multiple collectors."}, "name": "collector", "in": "query"}], "responses": {"200": {"description": "List files", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/FileSearchResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/search": {"get": {"summary": "Search Messages", "description": "The `/search` provides the combination of searching for MRT data files as well as parallel parsing of the data files\nand filtering based on provided parameters. The parsing phase spins up at most N independent processes where N is\nthe number of the logical CPU cores, and each process handles the parsing of one single MRT file. At the end of\nthe process, all parsed and filtered messages will be combined back together and returned as a single of list BGP\nmessages in JSON format.", "operationId": "search_messages_search_get", "parameters": [{"description": "start timestamp, in unix time or RFC3339 format", "required": true, "schema": {"title": "Ts Start", "type": "string", "description": "start timestamp, in unix time or RFC3339 format"}, "name": "ts_start", "in": "query"}, {"description": "end timestamp, in unix time or RFC3339 format", "required": true, "schema": {"title": "Ts End", "type": "string", "description": "end timestamp, in unix time or RFC3339 format"}, "name": "ts_end", "in": "query"}, {"description": "filter by project name, i.e. route-views or riperis", "required": false, "schema": {"title": "Project", "type": "string", "description": "filter by project name, i.e. route-views or riperis"}, "name": "project", "in": "query"}, {"description": "filter by collector name, e.g. rrc00 or route-views2. use comma to separate multiple collectors.", "required": false, "schema": {"title": "Collector", "type": "string", "description": "filter by collector name, e.g. rrc00 or route-views2. use comma to separate multiple collectors."}, "name": "collector", "in": "query"}, {"description": "filter by origin as", "required": false, "schema": {"title": "Origin", "type": "integer", "description": "filter by origin as"}, "name": "origin", "in": "query"}, {"description": "filter by collector peer IP address", "required": false, "schema": {"title": "Peer Ip", "type": "string", "description": "filter by collector peer IP address"}, "name": "peer_ip", "in": "query"}, {"description": "filter by collector peer IP ASN", "required": false, "schema": {"title": "Peer Asn", "type": "string", "description": "filter by collector peer IP ASN"}, "name": "peer_asn", "in": "query"}, {"description": "filter by prefix", "required": false, "schema": {"title": "Prefix", "type": "string", "description": "filter by prefix"}, "name": "prefix", "in": "query"}, {"description": "include super prefix", "required": false, "schema": {"title": "Include Super", "type": "boolean", "description": "include super prefix", "default": false}, "name": "include_super", "in": "query"}, {"description": "include sub prefix", "required": false, "schema": {"title": "Include Sub", "type": "boolean", "description": "include sub prefix", "default": false}, "name": "include_sub", "in": "query"}, {"description": "filter by AS path regular expression", "required": false, "schema": {"title": "As Path", "type": "string", "description": "filter by AS path regular expression"}, "name": "as_path", "in": "query"}, {"description": "filter by message type, i.e. announcement or withdrawal", "required": false, "schema": {"title": "Msg Type", "type": "string", "description": "filter by message type, i.e. announcement or withdrawal"}, "name": "msg_type", "in": "query"}, {"description": "limit the number of BGP messages returned for an API call", "required": false, "schema": {"title": "Msgs Limit", "type": "integer", "description": "limit the number of BGP messages returned for an API call", "default": 100}, "name": "msgs_limit", "in": "query"}, {"description": "limit the number of that will be used for parsing", "required": false, "schema": {"title": "Files Limit", "type": "integer", "description": "limit the number of that will be used for parsing"}, "name": "files_limit", "in": "query"}, {"description": "whether to skip parsing", "required": false, "schema": {"title": "Dry Run", "type": "boolean", "description": "whether to skip parsing", "default": false}, "name": "dry_run", "in": "query"}], "responses": {"200": {"description": "Parsed API", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ParseResult"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"BgpMessage": {"title": "BgpMessage", "required": ["timestamp", "timestamp_str", "elem_type", "peer_ip", "peer_asn", "prefix"], "type": "object", "properties": {"timestamp": {"title": "Timestamp", "type": "number"}, "timestamp_str": {"title": "Timestamp Str", "type": "string"}, "elem_type": {"title": "Elem Type", "type": "string"}, "peer_ip": {"title": "Peer Ip", "type": "string"}, "peer_asn": {"title": "Peer Asn", "type": "integer"}, "prefix": {"title": "Prefix", "type": "string"}, "next_hop": {"title": "Next Hop", "type": "string"}, "as_path": {"title": "As Path", "type": "string"}, "origin_asns": {"title": "Origin Asns", "type": "array", "items": {"type": "string"}}, "origin": {"title": "Origin", "type": "string"}, "local_pref": {"title": "Local Pref", "type": "integer"}, "med": {"title": "Med", "type": "integer"}, "communities": {"title": "Communities", "type": "array", "items": {"type": "string"}}, "atomic": {"title": "Atomic", "type": "string"}, "aggr_asn": {"title": "Aggr Asn", "type": "integer"}, "aggr_ip": {"title": "Aggr Ip", "type": "string"}}}, "FileSearchResult": {"title": "FileSearchResult", "required": ["count", "total_size", "files"], "type": "object", "properties": {"count": {"title": "Count", "type": "integer"}, "total_size": {"title": "Total Size", "type": "integer"}, "error": {"title": "Error", "type": "string"}, "files": {"title": "Files", "type": "array", "items": {"$ref": "#/components/schemas/MrtFile"}}}}, "HTTPValidationError": {"title": "HTTPValidationError", "type": "object", "properties": {"detail": {"title": "Detail", "type": "array", "items": {"$ref": "#/components/schemas/ValidationError"}}}}, "MrtFile": {"title": "MrtFile", "required": ["url", "project", "collector", "data_type", "size"], "type": "object", "properties": {"url": {"title": "Url", "type": "string"}, "project": {"title": "Project", "type": "string"}, "collector": {"title": "Collector", "type": "string"}, "data_type": {"title": "Data Type", "type": "string"}, "size": {"title": "Size", "type": "integer"}}}, "ParseResult": {"title": "ParseResult", "required": ["count", "msgs", "files"], "type": "object", "properties": {"count": {"title": "Count", "type": "integer"}, "error": {"title": "Error", "type": "string"}, "msgs": {"title": "Msgs", "type": "array", "items": {"$ref": "#/components/schemas/BgpMessage"}}, "files": {"$ref": "#/components/schemas/FileSearchResult"}}}, "ValidationError": {"title": "ValidationError", "required": ["loc", "msg", "type"], "type": "object", "properties": {"loc": {"title": "Location", "type": "array", "items": {"type": "string"}}, "msg": {"title": "Message", "type": "string"}, "type": {"title": "Error Type", "type": "string"}}}}}}