{ "openapi": "3.0.0", "info": { "title": "Seldon External API", "version": "0.1", "contact": { "name": "Seldon Core", "url": "https://github.com/SeldonIO/seldon-core" } }, "externalDocs": { "description": "Seldon Core Documentation", "url": "https://github.com/SeldonIO/seldon-core" }, "servers": [ { "url": "http://{host}:{port}", "variables": { "host": { "default": "localhost", "description": "host running seldon core" }, "port": { "default": "80" } } }, { "url": "http://localhost:8002", "description": "fixed host as swagger UI has bug with variables for auth" } ], "paths": { "/aggregate": { "post": { "operationId": "Aggregate2", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "tags": [ "Internal" ], "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "json": { "$ref": "#/components/schemas/SeldonMessageList" } } }, "encoding": { "json": { "contentType": "application/json" } } } }, "required": true } }, "get": { "operationId": "Aggregate", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "parameters": [ { "name": "body", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/SeldonMessageList" } } ], "tags": [ "Internal" ] } }, "/predict": { "get": { "operationId": "TransformInput4", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "parameters": [ { "name": "json", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/SeldonMessage" }, "example": { "json": "{\"data\":{\"names\" : [\"feature1\"],\"tensor\" : {\"shape\": [1,1],\"values\": [1]}}}" } } ], "tags": [ "Internal" ] }, "post": { "operationId": "TransformInput3", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "tags": [ "Internal" ], "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "json": { "$ref": "#/components/schemas/SeldonMessage" } } }, "encoding": { "json": { "contentType": "application/json" } } } }, "required": true } } }, "/route": { "get": { "operationId": "Route2", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "parameters": [ { "name": "json", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/SeldonMessage" } } ], "tags": [ "Internal" ] }, "post": { "operationId": "Route", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "tags": [ "Internal" ], "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "json": { "$ref": "#/components/schemas/SeldonMessage" } } }, "encoding": { "json": { "contentType": "application/json" } } } }, "required": true } } }, "/send-feedback": { "get": { "operationId": "SendFeedback2", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "parameters": [ { "name": "json", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/Feedback" } } ], "tags": [ "Internal" ] }, "post": { "operationId": "SendFeedback", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "tags": [ "Internal" ], "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "json": { "$ref": "#/components/schemas/Feedback" } } }, "encoding": { "json": { "contentType": "application/json" } } } }, "required": true } } }, "/transform-input": { "get": { "operationId": "TransformInput2", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "parameters": [ { "name": "json", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/SeldonMessage" } } ], "tags": [ "Internal" ] }, "post": { "operationId": "TransformInput", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "tags": [ "Internal" ], "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "json": { "$ref": "#/components/schemas/SeldonMessage" } } }, "encoding": { "json": { "contentType": "application/json" } } } }, "required": true } } }, "/transform-output": { "get": { "operationId": "TransformOutput2", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "parameters": [ { "name": "json", "in": "query", "required": true, "schema": { "$ref": "#/components/schemas/SeldonMessage" } } ], "tags": [ "Internal" ] }, "post": { "operationId": "TransformOutput", "responses": { "200": { "description": "A successful response.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SeldonMessage" } } } } }, "tags": [ "Internal" ], "requestBody": { "content": { "application/x-www-form-urlencoded": { "schema": { "type": "object", "properties": { "json": { "$ref": "#/components/schemas/SeldonMessage" } } }, "encoding": { "json": { "contentType": "application/json" } } } }, "required": true } } } }, "components": { "schemas": { "StatusStatusFlag": { "type": "string", "enum": [ "SUCCESS", "FAILURE" ], "default": "SUCCESS" }, "AnyValue": { "description": "Can be anything: string, number, array, object, etc." }, "MetricType": { "type": "string", "enum": [ "COUNTER", "GAUGE", "TIMER" ], "default": "COUNTER" }, "Metric": { "type": "object", "properties": { "type": { "$ref": "#/components/schemas/MetricType" }, "key": { "type": "string" }, "value": { "type": "number", "format": "float" } } }, "DefaultData": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tensor": { "$ref": "#/components/schemas/Tensor" }, "ndarry": { "type": "array", "items": { "$ref": "#/components/schemas/AnyValue" } }, "tftensor": { "$ref": "#/components/schemas/TensorflowTensorProto" } } }, "Feedback": { "type": "object", "properties": { "request": { "$ref": "#/components/schemas/SeldonMessage" }, "response": { "$ref": "#/components/schemas/SeldonMessage" }, "reward": { "type": "number", "format": "float" }, "truth": { "$ref": "#/components/schemas/SeldonMessage" } } }, "Meta": { "type": "object", "properties": { "puid": { "type": "string" }, "tags": { "type": "object", "additionalProperties": { "$ref": "#/components/schemas/AnyValue" }, "example": { "mytag": "myvalue" } }, "routing": { "type": "object", "additionalProperties": { "type": "integer", "format": "int32" }, "example": { "router1": 1 } }, "requestPath": { "type": "object", "additionalProperties": { "type": "string" }, "example": { "classifier": "seldonio/mock_classifier:1.0" } }, "metrics": { "type": "array", "items": { "$ref": "#/components/schemas/Metric" } } } }, "SeldonMessage": { "type": "object", "properties": { "status": { "$ref": "#/components/schemas/Status" }, "meta": { "$ref": "#/components/schemas/Meta" }, "data": { "$ref": "#/components/schemas/DefaultData" }, "binData": { "type": "string", "format": "byte" }, "strData": { "type": "string" } } }, "SeldonMessageList": { "type": "object", "properties": { "seldonMessages": { "type": "array", "items": { "$ref": "#/components/schemas/SeldonMessage" } } } }, "Status": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "info": { "type": "string" }, "reason": { "type": "string" }, "status": { "$ref": "#/components/schemas/StatusStatusFlag" } } }, "Tensor": { "type": "object", "properties": { "shape": { "type": "array", "items": { "type": "integer", "format": "int32" } }, "values": { "type": "array", "items": { "type": "number", "format": "double" } } } }, "TensorShapeProtoDim": { "type": "object", "properties": { "size": { "type": "string", "format": "int64", "description": "Size of the tensor in that dimension.\nThis value must be >= -1, but values of -1 are reserved for \"unknown\"\nshapes (values of -1 mean \"unknown\" dimension). Certain wrappers\nthat work with TensorShapeProto may fail at runtime when deserializing\na TensorShapeProto containing a dim value of -1." }, "name": { "type": "string", "description": "Optional name of the tensor dimension." } }, "description": "One dimension of the tensor." }, "TensorflowDataType": { "type": "string", "enum": [ "DT_INVALID", "DT_FLOAT", "DT_DOUBLE", "DT_INT32", "DT_UINT8", "DT_INT16", "DT_INT8", "DT_STRING", "DT_COMPLEX64", "DT_INT64", "DT_BOOL", "DT_QINT8", "DT_QUINT8", "DT_QINT32", "DT_BFLOAT16", "DT_QINT16", "DT_QUINT16", "DT_UINT16", "DT_COMPLEX128", "DT_HALF", "DT_RESOURCE", "DT_VARIANT", "DT_UINT32", "DT_UINT64", "DT_FLOAT_REF", "DT_DOUBLE_REF", "DT_INT32_REF", "DT_UINT8_REF", "DT_INT16_REF", "DT_INT8_REF", "DT_STRING_REF", "DT_COMPLEX64_REF", "DT_INT64_REF", "DT_BOOL_REF", "DT_QINT8_REF", "DT_QUINT8_REF", "DT_QINT32_REF", "DT_BFLOAT16_REF", "DT_QINT16_REF", "DT_QUINT16_REF", "DT_UINT16_REF", "DT_COMPLEX128_REF", "DT_HALF_REF", "DT_RESOURCE_REF", "DT_VARIANT_REF", "DT_UINT32_REF", "DT_UINT64_REF" ], "default": "DT_INVALID", "description": "- DT_INVALID: Not a legal value for DataType. Used to indicate a DataType field\nhas not been set.\n - DT_FLOAT: Data types that all computation devices are expected to be\ncapable to support.\n - DT_FLOAT_REF: Do not use! These are only for parameters. Every enum above\nshould have a corresponding value below (verified by types_test).", "title": "LINT.IfChange" }, "TensorflowResourceHandleProto": { "type": "object", "properties": { "device": { "type": "string", "description": "Unique name for the device containing the resource." }, "container": { "type": "string", "description": "Container in which this resource is placed." }, "name": { "type": "string", "description": "Unique name of this resource." }, "hash_code": { "type": "string", "format": "uint64", "description": "Hash code for the type of the resource. Is only valid in the same device\nand in the same execution." }, "maybe_type_name": { "type": "string", "description": "For debug-only, the name of the type pointed to by this handle, if\navailable." } }, "description": "Protocol buffer representing a handle to a tensorflow resource. Handles are\nnot valid across executions, but can be serialized back and forth from within\na single run." }, "TensorflowTensorProto": { "type": "object", "properties": { "dtype": { "$ref": "#/components/schemas/TensorflowDataType" }, "tensor_shape": { "$ref": "#/components/schemas/TensorflowTensorShapeProto", "description": "Shape of the tensor. TODO(touts): sort out the 0-rank issues." }, "version_number": { "type": "integer", "format": "int32", "description": "Version number.\n\nIn version 0, if the \"repeated xxx\" representations contain only one\nelement, that element is repeated to fill the shape. This makes it easy\nto represent a constant Tensor with a single value." }, "tensor_content": { "type": "string", "format": "byte", "description": "Serialized raw tensor content from either Tensor::AsProtoTensorContent or\nmemcpy in tensorflow::grpc::EncodeTensorToByteBuffer. This representation\ncan be used for all tensor types. The purpose of this representation is to\nreduce serialization overhead during RPC call by avoiding serialization of\nmany repeated small items." }, "half_val": { "type": "array", "items": { "type": "integer", "format": "int32" }, "description": "DT_HALF, DT_BFLOAT16. Note that since protobuf has no int16 type, we'll\nhave some pointless zero padding for each value here." }, "float_val": { "type": "array", "items": { "type": "number", "format": "float" }, "description": "DT_FLOAT." }, "double_val": { "type": "array", "items": { "type": "number", "format": "double" }, "description": "DT_DOUBLE." }, "int_val": { "type": "array", "items": { "type": "integer", "format": "int32" }, "description": "DT_INT32, DT_INT16, DT_INT8, DT_UINT8." }, "string_val": { "type": "array", "items": { "type": "string", "format": "byte" }, "title": "DT_STRING" }, "scomplex_val": { "type": "array", "items": { "type": "number", "format": "float" }, "description": "DT_COMPLEX64. scomplex_val(2*i) and scomplex_val(2*i+1) are real\nand imaginary parts of i-th single precision complex." }, "int64_val": { "type": "array", "items": { "type": "string", "format": "int64" }, "title": "DT_INT64" }, "bool_val": { "type": "array", "items": { "type": "boolean", "format": "boolean" }, "title": "DT_BOOL" }, "dcomplex_val": { "type": "array", "items": { "type": "number", "format": "double" }, "description": "DT_COMPLEX128. dcomplex_val(2*i) and dcomplex_val(2*i+1) are real\nand imaginary parts of i-th double precision complex." }, "resource_handle_val": { "type": "array", "items": { "$ref": "#/components/schemas/TensorflowResourceHandleProto" }, "title": "DT_RESOURCE" }, "variant_val": { "type": "array", "items": { "$ref": "#/components/schemas/TensorflowVariantTensorDataProto" }, "title": "DT_VARIANT" }, "uint32_val": { "type": "array", "items": { "type": "integer", "format": "int64" }, "title": "DT_UINT32" }, "uint64_val": { "type": "array", "items": { "type": "string", "format": "uint64" }, "title": "DT_UINT64" } }, "description": "Protocol buffer representing a tensor." }, "TensorflowTensorShapeProto": { "type": "object", "properties": { "dim": { "type": "array", "items": { "$ref": "#/components/schemas/TensorShapeProtoDim" }, "description": "Dimensions of the tensor, such as {\"input\", 30}, {\"output\", 40}\nfor a 30 x 40 2D tensor. If an entry has size -1, this\ncorresponds to a dimension of unknown size. The names are\noptional.\n\nThe order of entries in \"dim\" matters: It indicates the layout of the\nvalues in the tensor in-memory representation.\n\nThe first entry in \"dim\" is the outermost dimension used to layout the\nvalues, the last entry is the innermost dimension. This matches the\nin-memory layout of RowMajor Eigen tensors.\n\nIf \"dim.size()\" > 0, \"unknown_rank\" must be false." }, "unknown_rank": { "type": "boolean", "format": "boolean", "description": "If true, the number of dimensions in the shape is unknown.\n\nIf true, \"dim.size()\" must be 0." } }, "description": "Dimensions of a tensor." }, "TensorflowVariantTensorDataProto": { "type": "object", "properties": { "type_name": { "type": "string", "description": "Name of the type of objects being serialized." }, "metadata": { "type": "string", "format": "byte", "description": "Portions of the object that are not Tensors." }, "tensors": { "type": "array", "items": { "$ref": "#/components/schemas/TensorflowTensorProto" }, "description": "Tensors contained within objects being serialized." } }, "description": "Protocol buffer representing the serialization format of DT_VARIANT tensors." } } } }