From c818af33e3519ac0385295b504ff91c2f84204b6 Mon Sep 17 00:00:00 2001 From: kpango Date: Mon, 4 Jul 2022 19:45:19 +0900 Subject: [PATCH] add values.go implementation Signed-off-by: kpango --- CHANGELOG.md | 2 +- Makefile | 25 +- Makefile.d/proto.mk | 35 +- apis/jsonschema/v1/payload/Control.json | 24 + apis/jsonschema/v1/payload/Discoverer.json | 33 + apis/jsonschema/v1/payload/Empty.json | 9 + apis/jsonschema/v1/payload/Filter.json | 44 ++ apis/jsonschema/v1/payload/Info.json | 243 ++++++ apis/jsonschema/v1/payload/Insert.json | 97 +++ apis/jsonschema/v1/payload/Object.json | 243 ++++++ apis/jsonschema/v1/payload/Remove.json | 59 ++ apis/jsonschema/v1/payload/Search.json | 213 +++++ apis/jsonschema/v1/payload/Update.json | 97 +++ apis/jsonschema/v1/payload/Upsert.json | 97 +++ apis/openapi/v1/agent/core/openapi.yaml | 162 ++++ apis/openapi/v1/agent/sidecar/openapi.yaml | 23 + apis/openapi/v1/discoverer/openapi.yaml | 204 +++++ apis/openapi/v1/filter/egress/openapi.yaml | 124 +++ apis/openapi/v1/filter/ingress/openapi.yaml | 124 +++ apis/openapi/v1/manager/index/openapi.yaml | 87 +++ apis/openapi/v1/payload/openapi.yaml | 23 + apis/openapi/v1/vald/openapi.yaml | 186 +++++ .../proto/v1/agent/core/agent.swagger.json | 193 ----- .../v1/agent/sidecar/sidecar.swagger.json | 49 -- .../v1/discoverer/discoverer.swagger.json | 269 ------- .../filter/egress/egress_filter.swagger.json | 152 ---- .../ingress/ingress_filter.swagger.json | 152 ---- .../manager/index/index_manager.swagger.json | 100 --- .../proto/v1/payload/payload.swagger.json | 52 -- .../apis/proto/v1/vald/filter.swagger.json | 738 ------------------ .../apis/proto/v1/vald/insert.swagger.json | 305 -------- .../apis/proto/v1/vald/object.swagger.json | 231 ------ .../apis/proto/v1/vald/remove.swagger.json | 264 ------- .../apis/proto/v1/vald/search.swagger.json | 552 ------------- .../apis/proto/v1/vald/update.swagger.json | 305 -------- .../apis/proto/v1/vald/upsert.swagger.json | 305 -------- charts/vald/templates/agent/hpa.yaml | 14 +- charts/vald/templates/discoverer/hpa.yaml | 14 +- charts/vald/values.go | 142 +--- docs/user-guides/configuration.md | 4 +- example/client/go.mod | 8 +- example/client/go.sum | 7 +- go.mod | 6 +- go.sum | 12 +- internal/config/backup.go | 33 - internal/config/backup_test.go | 175 ----- internal/config/compress.go | 47 +- internal/config/compress_test.go | 201 ----- internal/config/gateway.go | 78 -- internal/config/gateway_test.go | 255 ------ internal/config/{client.go => http.go} | 7 +- .../config/{client_test.go => http_test.go} | 18 +- internal/config/meta.go | 49 -- internal/config/meta_test.go | 222 ------ internal/config/sidecar.go | 4 +- pkg/agent/core/ngt/config/config.go | 87 --- pkg/agent/sidecar/config/config.go | 83 -- pkg/agent/sidecar/usecase/sidecar/sidecar.go | 2 +- pkg/gateway/filter/config/config.go | 83 -- pkg/gateway/lb/config/config.go | 83 -- pkg/manager/index/config/config.go | 83 -- 61 files changed, 2215 insertions(+), 5323 deletions(-) create mode 100644 apis/jsonschema/v1/payload/Control.json create mode 100644 apis/jsonschema/v1/payload/Discoverer.json create mode 100644 apis/jsonschema/v1/payload/Empty.json create mode 100644 apis/jsonschema/v1/payload/Filter.json create mode 100644 apis/jsonschema/v1/payload/Info.json create mode 100644 apis/jsonschema/v1/payload/Insert.json create mode 100644 apis/jsonschema/v1/payload/Object.json create mode 100644 apis/jsonschema/v1/payload/Remove.json create mode 100644 apis/jsonschema/v1/payload/Search.json create mode 100644 apis/jsonschema/v1/payload/Update.json create mode 100644 apis/jsonschema/v1/payload/Upsert.json create mode 100644 apis/openapi/v1/agent/core/openapi.yaml create mode 100644 apis/openapi/v1/agent/sidecar/openapi.yaml create mode 100644 apis/openapi/v1/discoverer/openapi.yaml create mode 100644 apis/openapi/v1/filter/egress/openapi.yaml create mode 100644 apis/openapi/v1/filter/ingress/openapi.yaml create mode 100644 apis/openapi/v1/manager/index/openapi.yaml create mode 100644 apis/openapi/v1/payload/openapi.yaml create mode 100644 apis/openapi/v1/vald/openapi.yaml delete mode 100644 apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json delete mode 100644 apis/swagger/v1/agent/sidecar/apis/proto/v1/agent/sidecar/sidecar.swagger.json delete mode 100644 apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json delete mode 100644 apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json delete mode 100644 apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json delete mode 100644 apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json delete mode 100644 apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json delete mode 100644 apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json delete mode 100644 apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json delete mode 100644 apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json delete mode 100644 apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json delete mode 100644 apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json delete mode 100644 apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json delete mode 100644 apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json delete mode 100644 internal/config/backup.go delete mode 100644 internal/config/backup_test.go delete mode 100644 internal/config/gateway.go delete mode 100644 internal/config/gateway_test.go rename internal/config/{client.go => http.go} (83%) rename internal/config/{client_test.go => http_test.go} (83%) delete mode 100644 internal/config/meta.go delete mode 100644 internal/config/meta_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index ea311820b8..2a6b72b80e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -696,7 +696,7 @@ - Update get started with using kubernetes ingress (#1510) - Fix command template (#1508) - Update dependencies version (#1501) -- modify .pb.go & swagger (#1493) +- modify .pb.go & openapi (#1493) - Add reshape vector proto, remove meta/backup proto (#1492) :pencil2: Documents diff --git a/Makefile b/Makefile index 68bfdf55b5..6708a506b5 100644 --- a/Makefile +++ b/Makefile @@ -54,17 +54,17 @@ TENSORFLOW_C_VERSION := $(eval TENSORFLOW_C_VERSION := $(shell cat versions/TENS OPERATOR_SDK_VERSION := $(eval OPERATOR_SDK_VERSION := $(shell cat versions/OPERATOR_SDK_VERSION))$(OPERATOR_SDK_VERSION) -KIND_VERSION ?= v0.14.0 -HELM_VERSION ?= v3.9.0 +GOLANGCILINT_VERSION ?= v1.46.2 HELM_DOCS_VERSION ?= 1.11.0 -YQ_VERSION ?= v4.25.3 -VALDCLI_VERSION ?= v1.5.4 -TELEPRESENCE_VERSION ?= 2.6.8 +HELM_VERSION ?= v3.9.0 +JAEGER_OPERATOR_VERSION ?= 2.30.0 +KIND_VERSION ?= v0.14.0 KUBELINTER_VERSION ?= 0.3.0 -GOLANGCILINT_VERSION ?= v1.46.2 -REVIEWDOG_VERSION ?= v0.14.1 PROTOBUF_VERSION ?= 21.2 -JAEGER_OPERATOR_VERSION ?= 2.30.0 +REVIEWDOG_VERSION ?= v0.14.1 +TELEPRESENCE_VERSION ?= 2.6.8 +VALDCLI_VERSION ?= v1.5.4 +YQ_VERSION ?= v4.25.3 SWAP_DEPLOYMENT_TYPE ?= deployment SWAP_IMAGE ?= "" @@ -96,7 +96,8 @@ BENCH_DATASET_HDF5_DIR = $(BENCH_DATASET_BASE_DIR)/$(BENCH_DATASET_HDF5_DIR_NAME PROTOS := $(eval PROTOS := $(shell find apis/proto -type f -regex ".*\.proto"))$(PROTOS) PROTOS_V1 := $(eval PROTOS_V1 := $(filter apis/proto/v1/%.proto,$(PROTOS)))$(PROTOS_V1) PBGOS = $(PROTOS:apis/proto/%.proto=apis/grpc/%.pb.go) -SWAGGERS = $(PROTOS:apis/proto/%.proto=apis/swagger/%.swagger.json) +OPENAPISPECS = $(PROTOS:apis/proto/%.proto=apis/openapi/%.openapi.json) +OPENAPIJSONSCHEMAS = $(PROTOS:apis/proto/%.proto=apis/jsonschema/%.schema.json) PBDOCS = apis/docs/v1/docs.md ifeq ($(GOARCH),amd64) @@ -197,7 +198,7 @@ GO_SOURCES = $(eval GO_SOURCES := $(shell find \ -not -path './hack/benchmark/internal/starter/gateway/*' \ -not -path './hack/gorules/*' \ -not -path './hack/license/*' \ - -not -path './hack/swagger/*' \ + -not -path './hack/openapi/*' \ -not -path './hack/tools/*' \ -not -path './tests/*' \ -type f \ @@ -227,7 +228,7 @@ GO_OPTION_SOURCES = $(eval GO_OPTION_SOURCES := $(shell find \ -not -path './hack/benchmark/internal/starter/gateway/*' \ -not -path './hack/gorules/*' \ -not -path './hack/license/*' \ - -not -path './hack/swagger/*' \ + -not -path './hack/openapi/*' \ -not -path './hack/tools/*' \ -not -path './tests/*' \ -type f \ @@ -320,7 +321,9 @@ clean: ./*.log \ ./*.svg \ ./apis/docs \ + ./apis/openapi \ ./apis/swagger \ + ./apis/jsonschema \ ./apis/grpc \ ./bench \ ./pprof \ diff --git a/Makefile.d/proto.mk b/Makefile.d/proto.mk index 097d1842b0..2d44108e8c 100644 --- a/Makefile.d/proto.mk +++ b/Makefile.d/proto.mk @@ -19,13 +19,17 @@ proto/all: \ proto/deps \ pbgo \ pbdoc \ - swagger + openapi \ + jsonschema .PHONY: pbgo pbgo: $(PBGOS) -.PHONY: swagger -swagger: $(SWAGGERS) +.PHONY: openapi +openapi: $(OPENAPISPECS) + +.PHONY: jsonschema +jsonschema: $(OPENAPIJSONSCHEMAS) .PHONY: pbdoc pbdoc: $(PBDOCS) @@ -33,7 +37,7 @@ pbdoc: $(PBDOCS) .PHONY: proto/clean ## clean proto artifacts proto/clean: - rm -rf apis/grpc apis/swagger apis/docs + rm -rf apis/grpc apis/openapi apis/docs .PHONY: proto/paths/print ## print proto paths @@ -48,7 +52,8 @@ proto/deps: \ $(GOPATH)/bin/protoc-gen-go-grpc \ $(GOPATH)/bin/protoc-gen-go-vtproto \ $(GOPATH)/bin/protoc-gen-grpc-gateway \ - $(GOPATH)/bin/protoc-gen-swagger \ + $(GOPATH)/bin/protoc-gen-jsonschema \ + $(GOPATH)/bin/protoc-gen-openapi \ $(GOPATH)/bin/protoc-gen-validate \ $(GOPATH)/bin/prototool \ $(GOPATH)/bin/swagger \ @@ -112,8 +117,11 @@ $(GOPATH)/bin/protoc-gen-go-grpc: $(GOPATH)/bin/protoc-gen-grpc-gateway: $(call go-install, github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway) -$(GOPATH)/bin/protoc-gen-swagger: - $(call go-install, github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger) +$(GOPATH)/bin/protoc-gen-openapi: + $(call go-install, github.com/google/gnostic/cmd/protoc-gen-openapi) + +$(GOPATH)/bin/protoc-gen-jsonschema: + $(call go-install, github.com/google/gnostic/cmd/protoc-gen-jsonschema) $(GOPATH)/bin/protoc-gen-validate: $(call go-install, github.com/envoyproxy/protoc-gen-validate) @@ -140,12 +148,19 @@ $(PBGOS): \ find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs sed -i -E "s%google.golang.org/grpc/status%github.com/vdaas/vald/internal/net/grpc/status%g" find $(ROOTDIR)/apis/grpc/* -name '*.go' | xargs sed -i -E "s%\"io\"%\"github.com/vdaas/vald/internal/io\"%g" -$(SWAGGERS): \ +$(OPENAPISPECS): \ + $(PROTOS) \ + proto/deps + @$(call green, "generating openapi.json files...") + $(call mkdir, $(dir $@)) + $(call protoc-gen, $(patsubst apis/openapi/%.openapi.json,apis/proto/%.proto,$@), --openapi_out=enum_type=string:$(dir $@)) + +$(OPENAPIJSONSCHEMAS): \ $(PROTOS) \ proto/deps - @$(call green, "generating swagger.json files...") + @$(call green, "generating schema.json files...") $(call mkdir, $(dir $@)) - $(call protoc-gen, $(patsubst apis/swagger/%.swagger.json,apis/proto/%.proto,$@), --swagger_out=json_names_for_fields=true:$(dir $@)) + $(call protoc-gen, $(patsubst apis/jsonschema/%.schema.json,apis/proto/%.proto,$@), --jsonschema_out=$(dir $@)) $(PBDOCS): \ $(PROTOS) \ diff --git a/apis/jsonschema/v1/payload/Control.json b/apis/jsonschema/v1/payload/Control.json new file mode 100644 index 0000000000..672a1ed403 --- /dev/null +++ b/apis/jsonschema/v1/payload/Control.json @@ -0,0 +1,24 @@ +{ + "title": "Control", + "$id": "Control.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Control related messages.", + "properties": { + }, + "definitions": { + "Control_CreateIndexRequest": { + "title": "CreateIndexRequest", + "type": "object", + "description": "Represent the create index request.", + "properties": { + "poolSize": { + "title": "poolSize", + "type": "integer", + "description": "The pool size of the create index operation.", + "format": "uint32" + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Discoverer.json b/apis/jsonschema/v1/payload/Discoverer.json new file mode 100644 index 0000000000..aa20bb94a6 --- /dev/null +++ b/apis/jsonschema/v1/payload/Discoverer.json @@ -0,0 +1,33 @@ +{ + "title": "Discoverer", + "$id": "Discoverer.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Discoverer related messages.", + "properties": { + }, + "definitions": { + "Discoverer_Request": { + "title": "Request", + "type": "object", + "description": "Represent the dicoverer request.", + "properties": { + "name": { + "title": "name", + "type": "string", + "description": "The agent name to be discover." + }, + "namespace": { + "title": "namespace", + "type": "string", + "description": "The namespace to be discover." + }, + "node": { + "title": "node", + "type": "string", + "description": "The node to be discover." + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Empty.json b/apis/jsonschema/v1/payload/Empty.json new file mode 100644 index 0000000000..7feb6e7ecc --- /dev/null +++ b/apis/jsonschema/v1/payload/Empty.json @@ -0,0 +1,9 @@ +{ + "title": "Empty", + "$id": "Empty.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Represent an empty message.", + "properties": { + } +} diff --git a/apis/jsonschema/v1/payload/Filter.json b/apis/jsonschema/v1/payload/Filter.json new file mode 100644 index 0000000000..2002953c96 --- /dev/null +++ b/apis/jsonschema/v1/payload/Filter.json @@ -0,0 +1,44 @@ +{ + "title": "Filter", + "$id": "Filter.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Filter related messages.", + "properties": { + }, + "definitions": { + "Filter_Target": { + "title": "Target", + "type": "object", + "description": "Represent the target filter server.", + "properties": { + "host": { + "title": "host", + "type": "string", + "description": "The target hostname." + }, + "port": { + "title": "port", + "type": "integer", + "description": "The target port.", + "format": "uint32" + } + } + }, + "Filter_Config": { + "title": "Config", + "type": "object", + "description": "Represent filter configuration.", + "properties": { + "targets": { + "title": "targets", + "type": "array", + "items": { + "$ref": "Filter_Target.json" + }, + "description": "Represent the filter target configuration." + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Info.json b/apis/jsonschema/v1/payload/Info.json new file mode 100644 index 0000000000..b88a6bdcc2 --- /dev/null +++ b/apis/jsonschema/v1/payload/Info.json @@ -0,0 +1,243 @@ +{ + "title": "Info", + "$id": "Info.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Info related messages.", + "properties": { + }, + "definitions": { + "Info_Index_Count": { + "title": "Count", + "type": "object", + "description": "Represent the index count message.", + "properties": { + "stored": { + "title": "stored", + "type": "integer", + "description": "The stored index count.", + "format": "uint32" + }, + "uncommitted": { + "title": "uncommitted", + "type": "integer", + "description": "The uncommitted index count.", + "format": "uint32" + }, + "indexing": { + "title": "indexing", + "type": "boolean", + "description": "The indexing index count." + }, + "saving": { + "title": "saving", + "type": "boolean", + "description": "The saving index count." + } + } + }, + "Info_Index_UUID_Committed": { + "title": "Committed", + "type": "object", + "description": "The committed UUID.", + "properties": { + "uuid": { + "title": "uuid", + "type": "string" + } + } + }, + "Info_Index_UUID_Uncommitted": { + "title": "Uncommitted", + "type": "object", + "description": "The uncommitted UUID.", + "properties": { + "uuid": { + "title": "uuid", + "type": "string" + } + } + }, + "Info_Index_UUID": { + "title": "UUID", + "type": "object", + "description": "Represent the UUID message.", + "properties": { + } + }, + "Info_Index": { + "title": "Index", + "type": "object", + "description": "Represent the index information messages.", + "properties": { + } + }, + "Info_Pod": { + "title": "Pod", + "type": "object", + "description": "Represent the pod information message.", + "properties": { + "appName": { + "title": "appName", + "type": "string", + "description": "The app name of the pod on the label." + }, + "name": { + "title": "name", + "type": "string", + "description": "The name of the pod." + }, + "namespace": { + "title": "namespace", + "type": "string", + "description": "The namespace of the pod." + }, + "ip": { + "title": "ip", + "type": "string", + "description": "The IP of the pod." + }, + "cpu": { + "description": "The CPU information of the pod.", + "$ref": "Info_CPU.json" + }, + "memory": { + "description": "The memory information of the pod.", + "$ref": "Info_Memory.json" + }, + "node": { + "description": "The node information of the pod.", + "$ref": "Info_Node.json" + } + } + }, + "Info_Node": { + "title": "Node", + "type": "object", + "description": "Represent the node information message.", + "properties": { + "name": { + "title": "name", + "type": "string", + "description": "The name of the node." + }, + "internalAddr": { + "title": "internalAddr", + "type": "string", + "description": "The internal IP address of the node." + }, + "externalAddr": { + "title": "externalAddr", + "type": "string", + "description": "The external IP address of the node." + }, + "cpu": { + "description": "The CPU information of the node.", + "$ref": "Info_CPU.json" + }, + "memory": { + "description": "The memory information of the node.", + "$ref": "Info_Memory.json" + }, + "Pods": { + "description": "The pod information of the node.", + "$ref": "Info_Pods.json" + } + } + }, + "Info_CPU": { + "title": "CPU", + "type": "object", + "description": "Represent the CPU information message.", + "properties": { + "limit": { + "title": "limit", + "type": "number", + "description": "The CPU resource limit.", + "format": "double" + }, + "request": { + "title": "request", + "type": "number", + "description": "The CPU resource requested.", + "format": "double" + }, + "usage": { + "title": "usage", + "type": "number", + "description": "The CPU usage.", + "format": "double" + } + } + }, + "Info_Memory": { + "title": "Memory", + "type": "object", + "description": "Represent the memory information message.", + "properties": { + "limit": { + "title": "limit", + "type": "number", + "description": "The memory limit.", + "format": "double" + }, + "request": { + "title": "request", + "type": "number", + "description": "The memory requested.", + "format": "double" + }, + "usage": { + "title": "usage", + "type": "number", + "description": "The memory usage.", + "format": "double" + } + } + }, + "Info_Pods": { + "title": "Pods", + "type": "object", + "description": "Represent the multiple pod information message.", + "properties": { + "pods": { + "title": "pods", + "type": "array", + "items": { + "$ref": "Info_Pod.json" + }, + "description": "The multiple pod information." + } + } + }, + "Info_Nodes": { + "title": "Nodes", + "type": "object", + "description": "Represent the multiple node information message.", + "properties": { + "nodes": { + "title": "nodes", + "type": "array", + "items": { + "$ref": "Info_Node.json" + }, + "description": "The multiple node information." + } + } + }, + "Info_IPs": { + "title": "IPs", + "type": "object", + "description": "Represent the multiple IP message.", + "properties": { + "ip": { + "title": "ip", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Insert.json b/apis/jsonschema/v1/payload/Insert.json new file mode 100644 index 0000000000..31b372cc89 --- /dev/null +++ b/apis/jsonschema/v1/payload/Insert.json @@ -0,0 +1,97 @@ +{ + "title": "Insert", + "$id": "Insert.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Insert related messages.", + "properties": { + }, + "definitions": { + "Insert_Request": { + "title": "Request", + "type": "object", + "description": "Represent the insert request.", + "properties": { + "vector": { + "description": "The vector to be inserted.", + "$ref": "Object_Vector.json" + }, + "config": { + "description": "The configuration of the insert request.", + "$ref": "Insert_Config.json" + } + } + }, + "Insert_MultiRequest": { + "title": "MultiRequest", + "type": "object", + "description": "Represent the multiple insert request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Insert_Request.json" + }, + "description": "Represent multiple insert request content." + } + } + }, + "Insert_ObjectRequest": { + "title": "ObjectRequest", + "type": "object", + "description": "Represent the insert by binary object request.", + "properties": { + "object": { + "description": "The binary object to be inserted.", + "$ref": "Object_Blob.json" + }, + "config": { + "description": "The configuration of the insert request.", + "$ref": "Insert_Config.json" + }, + "vectorizer": { + "description": "Filter configurations.", + "$ref": "Filter_Target.json" + } + } + }, + "Insert_MultiObjectRequest": { + "title": "MultiObjectRequest", + "type": "object", + "description": "Represent the multiple insert by binary object request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Insert_ObjectRequest.json" + }, + "description": "Represent multiple insert by object content." + } + } + }, + "Insert_Config": { + "title": "Config", + "type": "object", + "description": "Represent insert configurations.", + "properties": { + "skipStrictExistCheck": { + "title": "skipStrictExistCheck", + "type": "boolean", + "description": "A flag to skip exist check during insert operation." + }, + "filters": { + "description": "Filter configurations.", + "$ref": "Filter_Config.json" + }, + "timestamp": { + "title": "timestamp", + "type": "integer", + "description": "Insert timestamp.", + "format": "int64" + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Object.json b/apis/jsonschema/v1/payload/Object.json new file mode 100644 index 0000000000..76cab7249c --- /dev/null +++ b/apis/jsonschema/v1/payload/Object.json @@ -0,0 +1,243 @@ +{ + "title": "Object", + "$id": "Object.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Common messages.", + "properties": { + }, + "definitions": { + "Object_VectorRequest": { + "title": "VectorRequest", + "type": "object", + "description": "Represent a request to fetch raw vector.", + "properties": { + "id": { + "description": "The vector ID to be fetch.", + "$ref": "Object_ID.json" + }, + "filters": { + "description": "Filter configurations.", + "$ref": "Filter_Config.json" + } + } + }, + "Object_Distance": { + "title": "Distance", + "type": "object", + "description": "Represent the ID and distance pair.", + "properties": { + "id": { + "title": "id", + "type": "string", + "description": "The vector ID." + }, + "distance": { + "title": "distance", + "type": "number", + "description": "The distance.", + "format": "float" + } + } + }, + "Object_StreamDistance": { + "title": "StreamDistance", + "type": "object", + "description": "Represent stream response of distances.", + "properties": { + "distance": { + "description": "The distance.", + "$ref": "Object_Distance.json" + }, + "status": { + "description": "The RPC error status.", + "$ref": "Status.json" + } + } + }, + "Object_ID": { + "title": "ID", + "type": "object", + "description": "Represent the vector ID.", + "properties": { + "id": { + "title": "id", + "type": "string" + } + } + }, + "Object_IDs": { + "title": "IDs", + "type": "object", + "description": "Represent multiple vector IDs.", + "properties": { + "ids": { + "title": "ids", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Object_Vector": { + "title": "Vector", + "type": "object", + "description": "Represent a vector.", + "properties": { + "id": { + "title": "id", + "type": "string", + "description": "The vector ID." + }, + "vector": { + "title": "vector", + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "description": "The vector." + } + } + }, + "Object_Vectors": { + "title": "Vectors", + "type": "object", + "description": "Represent multiple vectors.", + "properties": { + "vectors": { + "title": "vectors", + "type": "array", + "items": { + "$ref": "Object_Vector.json" + } + } + } + }, + "Object_StreamVector": { + "title": "StreamVector", + "type": "object", + "description": "Represent stream response of the vector.", + "properties": { + "vector": { + "description": "The vector.", + "$ref": "Object_Vector.json" + }, + "status": { + "description": "The RPC error status.", + "$ref": "Status.json" + } + } + }, + "Object_ReshapeVector": { + "title": "ReshapeVector", + "type": "object", + "description": "Represent reshape vector.", + "properties": { + "object": { + "title": "object", + "type": "string", + "description": "The binary object.", + "format": "bytes" + }, + "shape": { + "title": "shape", + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "The new shape." + } + } + }, + "Object_Blob": { + "title": "Blob", + "type": "object", + "description": "Represent the binary object.", + "properties": { + "id": { + "title": "id", + "type": "string", + "description": "The object ID." + }, + "object": { + "title": "object", + "type": "string", + "description": "The binary object.", + "format": "bytes" + } + } + }, + "Object_StreamBlob": { + "title": "StreamBlob", + "type": "object", + "description": "Represent stream response of binary objects.", + "properties": { + "blob": { + "description": "The binary object.", + "$ref": "Object_Blob.json" + }, + "status": { + "description": "The RPC error status.", + "$ref": "Status.json" + } + } + }, + "Object_Location": { + "title": "Location", + "type": "object", + "description": "Represent the vector location.", + "properties": { + "name": { + "title": "name", + "type": "string", + "description": "The name of the location." + }, + "uuid": { + "title": "uuid", + "type": "string", + "description": "The UUID of the vector." + }, + "ips": { + "title": "ips", + "type": "array", + "items": { + "type": "string" + }, + "description": "The IP list." + } + } + }, + "Object_StreamLocation": { + "title": "StreamLocation", + "type": "object", + "description": "Represent the stream response of the vector location.", + "properties": { + "location": { + "description": "The vector location.", + "$ref": "Object_Location.json" + }, + "status": { + "description": "The RPC error status.", + "$ref": "Status.json" + } + } + }, + "Object_Locations": { + "title": "Locations", + "type": "object", + "description": "Represent multiple vector locations.", + "properties": { + "locations": { + "title": "locations", + "type": "array", + "items": { + "$ref": "Object_Location.json" + } + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Remove.json b/apis/jsonschema/v1/payload/Remove.json new file mode 100644 index 0000000000..450cf2b659 --- /dev/null +++ b/apis/jsonschema/v1/payload/Remove.json @@ -0,0 +1,59 @@ +{ + "title": "Remove", + "$id": "Remove.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Remove related messages.", + "properties": { + }, + "definitions": { + "Remove_Request": { + "title": "Request", + "type": "object", + "description": "Represent the remove request.", + "properties": { + "id": { + "description": "The object ID to be removed.", + "$ref": "Object_ID.json" + }, + "config": { + "description": "The configuration of the remove request.", + "$ref": "Remove_Config.json" + } + } + }, + "Remove_MultiRequest": { + "title": "MultiRequest", + "type": "object", + "description": "Represent the multiple remove request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Remove_Request.json" + }, + "description": "Represent the multiple remove request content." + } + } + }, + "Remove_Config": { + "title": "Config", + "type": "object", + "description": "Represent the remove configuration.", + "properties": { + "skipStrictExistCheck": { + "title": "skipStrictExistCheck", + "type": "boolean", + "description": "A flag to skip exist check during upsert operation." + }, + "timestamp": { + "title": "timestamp", + "type": "integer", + "description": "Remove timestamp.", + "format": "int64" + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Search.json b/apis/jsonschema/v1/payload/Search.json new file mode 100644 index 0000000000..4ed8e57699 --- /dev/null +++ b/apis/jsonschema/v1/payload/Search.json @@ -0,0 +1,213 @@ +{ + "title": "Search", + "$id": "Search.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Search related messages.", + "properties": { + }, + "definitions": { + "Search_Request": { + "title": "Request", + "type": "object", + "description": "Represent a search request.", + "properties": { + "vector": { + "title": "vector", + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "description": "The vector to be searched." + }, + "config": { + "description": "The configuration of the search request.", + "$ref": "Search_Config.json" + } + } + }, + "Search_MultiRequest": { + "title": "MultiRequest", + "type": "object", + "description": "Represent the multiple search request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Search_Request.json" + }, + "description": "Represent the multiple search request content." + } + } + }, + "Search_IDRequest": { + "title": "IDRequest", + "type": "object", + "description": "Represent a search by ID request.", + "properties": { + "id": { + "title": "id", + "type": "string", + "description": "The vector ID to be searched." + }, + "config": { + "description": "The configuration of the search request.", + "$ref": "Search_Config.json" + } + } + }, + "Search_MultiIDRequest": { + "title": "MultiIDRequest", + "type": "object", + "description": "Represent the multiple search by ID request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Search_IDRequest.json" + }, + "description": "Represent the multiple search by ID request content." + } + } + }, + "Search_ObjectRequest": { + "title": "ObjectRequest", + "type": "object", + "description": "Represent a search by binary object request.", + "properties": { + "object": { + "title": "object", + "type": "string", + "description": "The binary object to be searched.", + "format": "bytes" + }, + "config": { + "description": "The configuration of the search request.", + "$ref": "Search_Config.json" + }, + "vectorizer": { + "description": "Filter configuration.", + "$ref": "Filter_Target.json" + } + } + }, + "Search_MultiObjectRequest": { + "title": "MultiObjectRequest", + "type": "object", + "description": "Represent the multiple search by binary object request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Search_ObjectRequest.json" + }, + "description": "Represent the multiple search by binary object request content." + } + } + }, + "Search_Config": { + "title": "Config", + "type": "object", + "description": "Represent search configuration.", + "properties": { + "requestId": { + "title": "requestId", + "type": "string", + "description": "Unique request ID." + }, + "num": { + "title": "num", + "type": "integer", + "description": "Maximum number of result to be returned.", + "format": "uint32" + }, + "radius": { + "title": "radius", + "type": "number", + "description": "Search radius.", + "format": "float" + }, + "epsilon": { + "title": "epsilon", + "type": "number", + "description": "Search coefficient.", + "format": "float" + }, + "timeout": { + "title": "timeout", + "type": "integer", + "description": "Search timeout in nanoseconds.", + "format": "int64" + }, + "ingressFilters": { + "description": "Ingress filter configurations.", + "$ref": "Filter_Config.json" + }, + "egressFilters": { + "description": "Egress filter configurations.", + "$ref": "Filter_Config.json" + }, + "minNum": { + "title": "minNum", + "type": "integer", + "description": "Minimum number of result to be returned.", + "format": "uint32" + } + } + }, + "Search_Response": { + "title": "Response", + "type": "object", + "description": "Represent a search response.", + "properties": { + "requestId": { + "title": "requestId", + "type": "string", + "description": "The unique request ID." + }, + "results": { + "title": "results", + "type": "array", + "items": { + "$ref": "Object_Distance.json" + }, + "description": "Search results." + } + } + }, + "Search_Responses": { + "title": "Responses", + "type": "object", + "description": "Represent multiple search responses.", + "properties": { + "responses": { + "title": "responses", + "type": "array", + "items": { + "$ref": "Search_Response.json" + }, + "description": "Represent the multiple search response content." + } + } + }, + "Search_StreamResponse": { + "title": "StreamResponse", + "type": "object", + "description": "Represent stream search response.", + "properties": { + "response": { + "description": "Represent the search response.", + "$ref": "Search_Response.json" + }, + "status": { + "description": "The RPC error status.", + "$ref": "Status.json" + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Update.json b/apis/jsonschema/v1/payload/Update.json new file mode 100644 index 0000000000..dbf1fdb10b --- /dev/null +++ b/apis/jsonschema/v1/payload/Update.json @@ -0,0 +1,97 @@ +{ + "title": "Update", + "$id": "Update.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Update related messages", + "properties": { + }, + "definitions": { + "Update_Request": { + "title": "Request", + "type": "object", + "description": "Represent the update request.", + "properties": { + "vector": { + "description": "The vector to be updated.", + "$ref": "Object_Vector.json" + }, + "config": { + "description": "The configuration of the update request.", + "$ref": "Update_Config.json" + } + } + }, + "Update_MultiRequest": { + "title": "MultiRequest", + "type": "object", + "description": "Represent the multiple update request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Update_Request.json" + }, + "description": "Represent the multiple update request content." + } + } + }, + "Update_ObjectRequest": { + "title": "ObjectRequest", + "type": "object", + "description": "Represent the update binary object request.", + "properties": { + "object": { + "description": "The binary object to be updated.", + "$ref": "Object_Blob.json" + }, + "config": { + "description": "The configuration of the update request.", + "$ref": "Update_Config.json" + }, + "vectorizer": { + "description": "Filter target.", + "$ref": "Filter_Target.json" + } + } + }, + "Update_MultiObjectRequest": { + "title": "MultiObjectRequest", + "type": "object", + "description": "Represent the multiple update binary object request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Update_ObjectRequest.json" + }, + "description": "Represent the multiple update object request content." + } + } + }, + "Update_Config": { + "title": "Config", + "type": "object", + "description": "Represent the update configuration.", + "properties": { + "skipStrictExistCheck": { + "title": "skipStrictExistCheck", + "type": "boolean", + "description": "A flag to skip exist check during update operation." + }, + "filters": { + "description": "Filter configuration.", + "$ref": "Filter_Config.json" + }, + "timestamp": { + "title": "timestamp", + "type": "integer", + "description": "Update timestamp.", + "format": "int64" + } + } + } + } +} diff --git a/apis/jsonschema/v1/payload/Upsert.json b/apis/jsonschema/v1/payload/Upsert.json new file mode 100644 index 0000000000..47ca9d14d1 --- /dev/null +++ b/apis/jsonschema/v1/payload/Upsert.json @@ -0,0 +1,97 @@ +{ + "title": "Upsert", + "$id": "Upsert.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "Upsert related messages.", + "properties": { + }, + "definitions": { + "Upsert_Request": { + "title": "Request", + "type": "object", + "description": "Represent the upsert request.", + "properties": { + "vector": { + "description": "The vector to be upserted.", + "$ref": "Object_Vector.json" + }, + "config": { + "description": "The configuration of the upsert request.", + "$ref": "Upsert_Config.json" + } + } + }, + "Upsert_MultiRequest": { + "title": "MultiRequest", + "type": "object", + "description": "Represent mthe ultiple upsert request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Upsert_Request.json" + }, + "description": "Represent the multiple upsert request content." + } + } + }, + "Upsert_ObjectRequest": { + "title": "ObjectRequest", + "type": "object", + "description": "Represent the upsert binary object request.", + "properties": { + "object": { + "description": "The binary object to be upserted.", + "$ref": "Object_Blob.json" + }, + "config": { + "description": "The configuration of the upsert request.", + "$ref": "Upsert_Config.json" + }, + "vectorizer": { + "description": "Filter target.", + "$ref": "Filter_Target.json" + } + } + }, + "Upsert_MultiObjectRequest": { + "title": "MultiObjectRequest", + "type": "object", + "description": "Represent the multiple upsert binary object request.", + "properties": { + "requests": { + "title": "requests", + "type": "array", + "items": { + "$ref": "Upsert_ObjectRequest.json" + }, + "description": "Represent the multiple upsert object request content." + } + } + }, + "Upsert_Config": { + "title": "Config", + "type": "object", + "description": "Represent the upsert configuration.", + "properties": { + "skipStrictExistCheck": { + "title": "skipStrictExistCheck", + "type": "boolean", + "description": "A flag to skip exist check during upsert operation." + }, + "filters": { + "description": "Filter configuration.", + "$ref": "Filter_Config.json" + }, + "timestamp": { + "title": "timestamp", + "type": "integer", + "description": "Upsert timestamp.", + "format": "int64" + } + } + } + } +} diff --git a/apis/openapi/v1/agent/core/openapi.yaml b/apis/openapi/v1/agent/core/openapi.yaml new file mode 100644 index 0000000000..9a291f508a --- /dev/null +++ b/apis/openapi/v1/agent/core/openapi.yaml @@ -0,0 +1,162 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +openapi: 3.0.3 +info: + title: Agent API + description: Represent the agent service. + version: 0.0.1 +paths: + /index/create: + get: + tags: + - Agent + description: Represent the create index RPC. + operationId: Agent_CreateIndex + parameters: + - name: poolSize + in: query + description: The pool size of the create index operation. + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Empty' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /index/createandsave: + get: + tags: + - Agent + description: Represent the create and save index RPC. + operationId: Agent_CreateAndSaveIndex + parameters: + - name: poolSize + in: query + description: The pool size of the create index operation. + schema: + type: integer + format: uint32 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Empty' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /index/info: + get: + tags: + - Agent + description: Represent the RPC to get the agent index information. + operationId: Agent_IndexInfo + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Index_Count' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /index/save: + get: + tags: + - Agent + description: Represent the save index RPC. + operationId: Agent_SaveIndex + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Empty' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + schemas: + Empty: + type: object + properties: {} + description: Represent an empty message. + GoogleProtobufAny: + type: object + properties: + '@type': + type: string + description: The type of the serialized message. + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + Index_Count: + type: object + properties: + stored: + type: integer + description: The stored index count. + format: uint32 + uncommitted: + type: integer + description: The uncommitted index count. + format: uint32 + indexing: + type: boolean + description: The indexing index count. + saving: + type: boolean + description: The saving index count. + description: Represent the index count message. + Status: + type: object + properties: + code: + type: integer + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + format: int32 + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + items: + $ref: '#/components/schemas/GoogleProtobufAny' + description: A list of messages that carry the error details. There is a common set of message types for APIs to use. + description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' +tags: + - name: Agent diff --git a/apis/openapi/v1/agent/sidecar/openapi.yaml b/apis/openapi/v1/agent/sidecar/openapi.yaml new file mode 100644 index 0000000000..ba93ab6c73 --- /dev/null +++ b/apis/openapi/v1/agent/sidecar/openapi.yaml @@ -0,0 +1,23 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +openapi: 3.0.3 +info: + title: "" + version: 0.0.1 +paths: {} +components: + schemas: {} diff --git a/apis/openapi/v1/discoverer/openapi.yaml b/apis/openapi/v1/discoverer/openapi.yaml new file mode 100644 index 0000000000..cd782957c1 --- /dev/null +++ b/apis/openapi/v1/discoverer/openapi.yaml @@ -0,0 +1,204 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +openapi: 3.0.3 +info: + title: Discoverer API + description: Represent the discoverer service. + version: 0.0.1 +paths: + /discover/nodes: + post: + tags: + - Discoverer + description: Represent the RPC to get the node information. + operationId: Discoverer_Nodes + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Discoverer_Request' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Info_Nodes' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /discover/pods: + post: + tags: + - Discoverer + description: Represent the RPC to get the agent pods information. + operationId: Discoverer_Pods + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Discoverer_Request' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Info_Pods' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + schemas: + Discoverer_Request: + type: object + properties: + name: + type: string + description: The agent name to be discover. + namespace: + type: string + description: The namespace to be discover. + node: + type: string + description: The node to be discover. + description: Represent the dicoverer request. + GoogleProtobufAny: + type: object + properties: + '@type': + type: string + description: The type of the serialized message. + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + Info_CPU: + type: object + properties: + limit: + type: number + description: The CPU resource limit. + format: double + request: + type: number + description: The CPU resource requested. + format: double + usage: + type: number + description: The CPU usage. + format: double + description: Represent the CPU information message. + Info_Memory: + type: object + properties: + limit: + type: number + description: The memory limit. + format: double + request: + type: number + description: The memory requested. + format: double + usage: + type: number + description: The memory usage. + format: double + description: Represent the memory information message. + Info_Node: + type: object + properties: + name: + type: string + description: The name of the node. + internalAddr: + type: string + description: The internal IP address of the node. + externalAddr: + type: string + description: The external IP address of the node. + cpu: + $ref: '#/components/schemas/Info_CPU' + memory: + $ref: '#/components/schemas/Info_Memory' + Pods: + $ref: '#/components/schemas/Info_Pods' + description: Represent the node information message. + Info_Nodes: + type: object + properties: + nodes: + type: array + items: + $ref: '#/components/schemas/Info_Node' + description: The multiple node information. + description: Represent the multiple node information message. + Info_Pod: + type: object + properties: + appName: + type: string + description: The app name of the pod on the label. + name: + type: string + description: The name of the pod. + namespace: + type: string + description: The namespace of the pod. + ip: + type: string + description: The IP of the pod. + cpu: + $ref: '#/components/schemas/Info_CPU' + memory: + $ref: '#/components/schemas/Info_Memory' + node: + $ref: '#/components/schemas/Info_Node' + description: Represent the pod information message. + Info_Pods: + type: object + properties: + pods: + type: array + items: + $ref: '#/components/schemas/Info_Pod' + description: The multiple pod information. + description: Represent the multiple pod information message. + Status: + type: object + properties: + code: + type: integer + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + format: int32 + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + items: + $ref: '#/components/schemas/GoogleProtobufAny' + description: A list of messages that carry the error details. There is a common set of message types for APIs to use. + description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' +tags: + - name: Discoverer diff --git a/apis/openapi/v1/filter/egress/openapi.yaml b/apis/openapi/v1/filter/egress/openapi.yaml new file mode 100644 index 0000000000..63c552bfdf --- /dev/null +++ b/apis/openapi/v1/filter/egress/openapi.yaml @@ -0,0 +1,124 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +openapi: 3.0.3 +info: + title: Filter API + description: Represent the egress filter service. + version: 0.0.1 +paths: + /filter/egress/distance: + post: + tags: + - Filter + description: Represent the RPC to filter the distance. + operationId: Filter_FilterDistance + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Distance' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Distance' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /filter/egress/vector: + post: + tags: + - Filter + description: Represent the RPC to filter the vector. + operationId: Filter_FilterVector + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Vector' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Vector' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + schemas: + GoogleProtobufAny: + type: object + properties: + '@type': + type: string + description: The type of the serialized message. + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + Object_Distance: + type: object + properties: + id: + type: string + description: The vector ID. + distance: + type: number + description: The distance. + format: float + description: Represent the ID and distance pair. + Object_Vector: + type: object + properties: + id: + type: string + description: The vector ID. + vector: + type: array + items: + type: number + format: float + description: The vector. + description: Represent a vector. + Status: + type: object + properties: + code: + type: integer + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + format: int32 + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + items: + $ref: '#/components/schemas/GoogleProtobufAny' + description: A list of messages that carry the error details. There is a common set of message types for APIs to use. + description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' +tags: + - name: Filter diff --git a/apis/openapi/v1/filter/ingress/openapi.yaml b/apis/openapi/v1/filter/ingress/openapi.yaml new file mode 100644 index 0000000000..7b0034ed22 --- /dev/null +++ b/apis/openapi/v1/filter/ingress/openapi.yaml @@ -0,0 +1,124 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +openapi: 3.0.3 +info: + title: Filter API + description: Represent the ingress filter service. + version: 0.0.1 +paths: + /filter/ingress/object: + post: + tags: + - Filter + description: Represent the RPC to generate the vector. + operationId: Filter_GenVector + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Blob' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Vector' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /filter/ingress/vector: + post: + tags: + - Filter + description: Represent the RPC to filter the vector. + operationId: Filter_FilterVector + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Vector' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Vector' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + schemas: + GoogleProtobufAny: + type: object + properties: + '@type': + type: string + description: The type of the serialized message. + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + Object_Blob: + type: object + properties: + id: + type: string + description: The object ID. + object: + type: string + description: The binary object. + format: bytes + description: Represent the binary object. + Object_Vector: + type: object + properties: + id: + type: string + description: The vector ID. + vector: + type: array + items: + type: number + format: float + description: The vector. + description: Represent a vector. + Status: + type: object + properties: + code: + type: integer + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + format: int32 + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + items: + $ref: '#/components/schemas/GoogleProtobufAny' + description: A list of messages that carry the error details. There is a common set of message types for APIs to use. + description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' +tags: + - name: Filter diff --git a/apis/openapi/v1/manager/index/openapi.yaml b/apis/openapi/v1/manager/index/openapi.yaml new file mode 100644 index 0000000000..00bd724136 --- /dev/null +++ b/apis/openapi/v1/manager/index/openapi.yaml @@ -0,0 +1,87 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +openapi: 3.0.3 +info: + title: Index API + description: Represent the index manager service. + version: 0.0.1 +paths: + /index/info: + get: + tags: + - Index + description: Represent the RPC to get the index information. + operationId: Index_IndexInfo + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Index_Count' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + schemas: + GoogleProtobufAny: + type: object + properties: + '@type': + type: string + description: The type of the serialized message. + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + Index_Count: + type: object + properties: + stored: + type: integer + description: The stored index count. + format: uint32 + uncommitted: + type: integer + description: The uncommitted index count. + format: uint32 + indexing: + type: boolean + description: The indexing index count. + saving: + type: boolean + description: The saving index count. + description: Represent the index count message. + Status: + type: object + properties: + code: + type: integer + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + format: int32 + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + items: + $ref: '#/components/schemas/GoogleProtobufAny' + description: A list of messages that carry the error details. There is a common set of message types for APIs to use. + description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' +tags: + - name: Index diff --git a/apis/openapi/v1/payload/openapi.yaml b/apis/openapi/v1/payload/openapi.yaml new file mode 100644 index 0000000000..ba93ab6c73 --- /dev/null +++ b/apis/openapi/v1/payload/openapi.yaml @@ -0,0 +1,23 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +openapi: 3.0.3 +info: + title: "" + version: 0.0.1 +paths: {} +components: + schemas: {} diff --git a/apis/openapi/v1/vald/openapi.yaml b/apis/openapi/v1/vald/openapi.yaml new file mode 100644 index 0000000000..7b437de95b --- /dev/null +++ b/apis/openapi/v1/vald/openapi.yaml @@ -0,0 +1,186 @@ +# +# Copyright (C) 2019-2022 vdaas.org vald team +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +openapi: 3.0.3 +info: + title: Upsert API + description: Upsert service provides ways to insert/update vectors. + version: 0.0.1 +paths: + /upsert: + post: + tags: + - Upsert + description: A method to insert/update a vector. + operationId: Upsert_Upsert + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Upsert_Request' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Location' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' + /upsert/multiple: + post: + tags: + - Upsert + description: A method to insert/update multiple vectors in a single request. + operationId: Upsert_MultiUpsert + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Upsert_MultiRequest' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Object_Locations' + default: + description: Default error response + content: + application/json: + schema: + $ref: '#/components/schemas/Status' +components: + schemas: + Filter_Config: + type: object + properties: + targets: + type: array + items: + $ref: '#/components/schemas/Filter_Target' + description: Represent the filter target configuration. + description: Represent filter configuration. + Filter_Target: + type: object + properties: + host: + type: string + description: The target hostname. + port: + type: integer + description: The target port. + format: uint32 + description: Represent the target filter server. + GoogleProtobufAny: + type: object + properties: + '@type': + type: string + description: The type of the serialized message. + additionalProperties: true + description: Contains an arbitrary serialized message along with a @type that describes the type of the serialized message. + Object_Location: + type: object + properties: + name: + type: string + description: The name of the location. + uuid: + type: string + description: The UUID of the vector. + ips: + type: array + items: + type: string + description: The IP list. + description: Represent the vector location. + Object_Locations: + type: object + properties: + locations: + type: array + items: + $ref: '#/components/schemas/Object_Location' + description: Represent multiple vector locations. + Object_Vector: + type: object + properties: + id: + type: string + description: The vector ID. + vector: + type: array + items: + type: number + format: float + description: The vector. + description: Represent a vector. + Status: + type: object + properties: + code: + type: integer + description: The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + format: int32 + message: + type: string + description: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + details: + type: array + items: + $ref: '#/components/schemas/GoogleProtobufAny' + description: A list of messages that carry the error details. There is a common set of message types for APIs to use. + description: 'The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).' + Upsert_Config: + type: object + properties: + skipStrictExistCheck: + type: boolean + description: A flag to skip exist check during upsert operation. + filters: + $ref: '#/components/schemas/Filter_Config' + timestamp: + type: integer + description: Upsert timestamp. + format: int64 + description: Represent the upsert configuration. + Upsert_MultiRequest: + type: object + properties: + requests: + type: array + items: + $ref: '#/components/schemas/Upsert_Request' + description: Represent the multiple upsert request content. + description: Represent mthe ultiple upsert request. + Upsert_Request: + type: object + properties: + vector: + $ref: '#/components/schemas/Object_Vector' + config: + $ref: '#/components/schemas/Upsert_Config' + description: Represent the upsert request. +tags: + - name: Upsert diff --git a/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json b/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json deleted file mode 100644 index 7d93adb8a2..0000000000 --- a/apis/swagger/v1/agent/core/apis/proto/v1/agent/core/agent.swagger.json +++ /dev/null @@ -1,193 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/agent/core/agent.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/index/create": { - "get": { - "summary": "Represent the create index RPC.", - "operationId": "Agent_CreateIndex", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1Empty" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "poolSize", - "description": "The pool size of the create index operation.", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "Agent" - ] - } - }, - "/index/createandsave": { - "get": { - "summary": "Represent the create and save index RPC.", - "operationId": "Agent_CreateAndSaveIndex", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1Empty" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "poolSize", - "description": "The pool size of the create index operation.", - "in": "query", - "required": false, - "type": "integer", - "format": "int64" - } - ], - "tags": [ - "Agent" - ] - } - }, - "/index/info": { - "get": { - "summary": "Represent the RPC to get the agent index information.", - "operationId": "Agent_IndexInfo", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/IndexCount" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "tags": [ - "Agent" - ] - } - }, - "/index/save": { - "get": { - "summary": "Represent the save index RPC.", - "operationId": "Agent_SaveIndex", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1Empty" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "tags": [ - "Agent" - ] - } - } - }, - "definitions": { - "IndexCount": { - "type": "object", - "properties": { - "stored": { - "type": "integer", - "format": "int64", - "description": "The stored index count." - }, - "uncommitted": { - "type": "integer", - "format": "int64", - "description": "The uncommitted index count." - }, - "indexing": { - "type": "boolean", - "description": "The indexing index count." - }, - "saving": { - "type": "boolean", - "description": "The saving index count." - } - }, - "description": "Represent the index count message." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1Empty": { - "type": "object", - "description": "Represent an empty message." - } - } -} diff --git a/apis/swagger/v1/agent/sidecar/apis/proto/v1/agent/sidecar/sidecar.swagger.json b/apis/swagger/v1/agent/sidecar/apis/proto/v1/agent/sidecar/sidecar.swagger.json deleted file mode 100644 index 5b167cef79..0000000000 --- a/apis/swagger/v1/agent/sidecar/apis/proto/v1/agent/sidecar/sidecar.swagger.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/agent/sidecar/sidecar.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string" - }, - "value": { - "type": "string", - "format": "byte" - } - } - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json b/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json deleted file mode 100644 index 4efe206edb..0000000000 --- a/apis/swagger/v1/discoverer/apis/proto/v1/discoverer/discoverer.swagger.json +++ /dev/null @@ -1,269 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/discoverer/discoverer.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/discover/nodes": { - "post": { - "summary": "Represent the RPC to get the node information.", - "operationId": "Discoverer_Nodes", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/InfoNodes" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1DiscovererRequest" - } - } - ], - "tags": [ - "Discoverer" - ] - } - }, - "/discover/pods": { - "post": { - "summary": "Represent the RPC to get the agent pods information.", - "operationId": "Discoverer_Pods", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/InfoPods" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1DiscovererRequest" - } - } - ], - "tags": [ - "Discoverer" - ] - } - } - }, - "definitions": { - "InfoCPU": { - "type": "object", - "properties": { - "limit": { - "type": "number", - "format": "double", - "description": "The CPU resource limit." - }, - "request": { - "type": "number", - "format": "double", - "description": "The CPU resource requested." - }, - "usage": { - "type": "number", - "format": "double", - "description": "The CPU usage." - } - }, - "description": "Represent the CPU information message." - }, - "InfoMemory": { - "type": "object", - "properties": { - "limit": { - "type": "number", - "format": "double", - "description": "The memory limit." - }, - "request": { - "type": "number", - "format": "double", - "description": "The memory requested." - }, - "usage": { - "type": "number", - "format": "double", - "description": "The memory usage." - } - }, - "description": "Represent the memory information message." - }, - "InfoNode": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the node." - }, - "internalAddr": { - "type": "string", - "description": "The internal IP address of the node." - }, - "externalAddr": { - "type": "string", - "description": "The external IP address of the node." - }, - "cpu": { - "$ref": "#/definitions/InfoCPU", - "description": "The CPU information of the node." - }, - "memory": { - "$ref": "#/definitions/InfoMemory", - "description": "The memory information of the node." - }, - "Pods": { - "$ref": "#/definitions/InfoPods", - "description": "The pod information of the node." - } - }, - "description": "Represent the node information message." - }, - "InfoNodes": { - "type": "object", - "properties": { - "nodes": { - "type": "array", - "items": { - "$ref": "#/definitions/InfoNode" - }, - "description": "The multiple node information." - } - }, - "description": "Represent the multiple node information message." - }, - "InfoPod": { - "type": "object", - "properties": { - "appName": { - "type": "string", - "description": "The app name of the pod on the label." - }, - "name": { - "type": "string", - "description": "The name of the pod." - }, - "namespace": { - "type": "string", - "description": "The namespace of the pod." - }, - "ip": { - "type": "string", - "description": "The IP of the pod." - }, - "cpu": { - "$ref": "#/definitions/InfoCPU", - "description": "The CPU information of the pod." - }, - "memory": { - "$ref": "#/definitions/InfoMemory", - "description": "The memory information of the pod." - }, - "node": { - "$ref": "#/definitions/InfoNode", - "description": "The node information of the pod." - } - }, - "description": "Represent the pod information message." - }, - "InfoPods": { - "type": "object", - "properties": { - "pods": { - "type": "array", - "items": { - "$ref": "#/definitions/InfoPod" - }, - "description": "The multiple pod information." - } - }, - "description": "Represent the multiple pod information message." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1DiscovererRequest": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The agent name to be discover." - }, - "namespace": { - "type": "string", - "description": "The namespace to be discover." - }, - "node": { - "type": "string", - "description": "The node to be discover." - } - }, - "description": "Represent the dicoverer request." - } - } -} diff --git a/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json b/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json deleted file mode 100644 index 3d932c1687..0000000000 --- a/apis/swagger/v1/filter/egress/apis/proto/v1/filter/egress/egress_filter.swagger.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/filter/egress/egress_filter.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/filter/egress/distance": { - "post": { - "summary": "Represent the RPC to filter the distance.", - "operationId": "Filter_FilterDistance", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectDistance" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ObjectDistance" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/filter/egress/vector": { - "post": { - "summary": "Represent the RPC to filter the vector.", - "operationId": "Filter_FilterVector", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectVector" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ObjectVector" - } - } - ], - "tags": [ - "Filter" - ] - } - } - }, - "definitions": { - "ObjectDistance": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "distance": { - "type": "number", - "format": "float", - "description": "The distance." - } - }, - "description": "Represent the ID and distance pair." - }, - "ObjectVector": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "vector": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "description": "The vector." - } - }, - "description": "Represent a vector." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json b/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json deleted file mode 100644 index b866983811..0000000000 --- a/apis/swagger/v1/filter/ingress/apis/proto/v1/filter/ingress/ingress_filter.swagger.json +++ /dev/null @@ -1,152 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/filter/ingress/ingress_filter.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/filter/ingress/object": { - "post": { - "summary": "Represent the RPC to generate the vector.", - "operationId": "Filter_GenVector", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectVector" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ObjectBlob" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/filter/ingress/vector": { - "post": { - "summary": "Represent the RPC to filter the vector.", - "operationId": "Filter_FilterVector", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectVector" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ObjectVector" - } - } - ], - "tags": [ - "Filter" - ] - } - } - }, - "definitions": { - "ObjectBlob": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The object ID." - }, - "object": { - "type": "string", - "format": "byte", - "description": "The binary object." - } - }, - "description": "Represent the binary object." - }, - "ObjectVector": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "vector": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "description": "The vector." - } - }, - "description": "Represent a vector." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json b/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json deleted file mode 100644 index dfeeae143a..0000000000 --- a/apis/swagger/v1/manager/index/apis/proto/v1/manager/index/index_manager.swagger.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/manager/index/index_manager.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/index/info": { - "get": { - "summary": "Represent the RPC to get the index information.", - "operationId": "Index_IndexInfo", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/IndexCount" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "tags": [ - "Index" - ] - } - } - }, - "definitions": { - "IndexCount": { - "type": "object", - "properties": { - "stored": { - "type": "integer", - "format": "int64", - "description": "The stored index count." - }, - "uncommitted": { - "type": "integer", - "format": "int64", - "description": "The uncommitted index count." - }, - "indexing": { - "type": "boolean", - "description": "The indexing index count." - }, - "saving": { - "type": "boolean", - "description": "The saving index count." - } - }, - "description": "Represent the index count message." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json b/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json deleted file mode 100644 index 1666450e6d..0000000000 --- a/apis/swagger/v1/payload/apis/proto/v1/payload/payload.swagger.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/payload/payload.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": {}, - "definitions": { - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - } - } -} diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json deleted file mode 100644 index bfb8b8b573..0000000000 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/filter.swagger.json +++ /dev/null @@ -1,738 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/vald/filter.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/insert/object": { - "post": { - "summary": "A method insert object.", - "operationId": "Filter_InsertObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ObjectLocation" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1InsertObjectRequest" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/insert/object/multiple": { - "post": { - "summary": "A method to insert multiple objects.", - "operationId": "Filter_MultiInsertObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectLocations" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1InsertMultiObjectRequest" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/search/object": { - "post": { - "summary": "A method to search object.", - "operationId": "Filter_SearchObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1SearchObjectRequest" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/search/object/multiple": { - "post": { - "summary": "A method to search multiple objects.", - "operationId": "Filter_MultiSearchObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponses" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1SearchMultiObjectRequest" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/update/object": { - "post": { - "summary": "A method to update object.", - "operationId": "Filter_UpdateObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ObjectLocation" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpdateObjectRequest" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/update/object/multiple": { - "post": { - "summary": "A method to update multiple objects.", - "operationId": "Filter_MultiUpdateObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectLocations" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpdateMultiObjectRequest" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/upsert/object": { - "post": { - "summary": "A method to upsert object.", - "operationId": "Filter_UpsertObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ObjectLocation" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpsertObjectRequest" - } - } - ], - "tags": [ - "Filter" - ] - } - }, - "/upsert/object/multiple": { - "post": { - "summary": "A method to upsert multiple objects.", - "operationId": "Filter_MultiUpsertObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectLocations" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpsertMultiObjectRequest" - } - } - ], - "tags": [ - "Filter" - ] - } - } - }, - "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, - "ObjectBlob": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The object ID." - }, - "object": { - "type": "string", - "format": "byte", - "description": "The binary object." - } - }, - "description": "Represent the binary object." - }, - "ObjectDistance": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "distance": { - "type": "number", - "format": "float", - "description": "The distance." - } - }, - "description": "Represent the ID and distance pair." - }, - "ObjectLocations": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "$ref": "#/definitions/v1ObjectLocation" - } - } - }, - "description": "Represent multiple vector locations." - }, - "ObjectStreamLocation": { - "type": "object", - "properties": { - "location": { - "$ref": "#/definitions/v1ObjectLocation", - "description": "The vector location." - }, - "status": { - "$ref": "#/definitions/rpcStatus", - "description": "The RPC error status." - } - }, - "description": "Represent the stream response of the vector location." - }, - "SearchResponse": { - "type": "object", - "properties": { - "requestId": { - "type": "string", - "description": "The unique request ID." - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/ObjectDistance" - }, - "description": "Search results." - } - }, - "description": "Represent a search response." - }, - "SearchResponses": { - "type": "object", - "properties": { - "responses": { - "type": "array", - "items": { - "$ref": "#/definitions/SearchResponse" - }, - "description": "Represent the multiple search response content." - } - }, - "description": "Represent multiple search responses." - }, - "SearchStreamResponse": { - "type": "object", - "properties": { - "response": { - "$ref": "#/definitions/SearchResponse", - "description": "Represent the search response." - }, - "status": { - "$ref": "#/definitions/rpcStatus", - "description": "The RPC error status." - } - }, - "description": "Represent stream search response." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpcCode": { - "type": "integer", - "format": "int32" - }, - "httpCode": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "httpStatus": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1FilterConfig": { - "type": "object", - "properties": { - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/FilterTarget" - }, - "description": "Represent the filter target configuration." - } - }, - "description": "Represent filter configuration." - }, - "v1InsertConfig": { - "type": "object", - "properties": { - "skipStrictExistCheck": { - "type": "boolean", - "description": "A flag to skip exist check during insert operation." - }, - "filters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Filter configurations." - }, - "timestamp": { - "type": "string", - "format": "int64", - "description": "Insert timestamp." - } - }, - "description": "Represent insert configurations." - }, - "v1InsertMultiObjectRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1InsertObjectRequest" - }, - "description": "Represent multiple insert by object content." - } - }, - "description": "Represent the multiple insert by binary object request." - }, - "v1InsertObjectRequest": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/ObjectBlob", - "description": "The binary object to be inserted." - }, - "config": { - "$ref": "#/definitions/v1InsertConfig", - "description": "The configuration of the insert request." - }, - "vectorizer": { - "$ref": "#/definitions/FilterTarget", - "description": "Filter configurations." - } - }, - "description": "Represent the insert by binary object request." - }, - "v1ObjectLocation": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the location." - }, - "uuid": { - "type": "string", - "description": "The UUID of the vector." - }, - "ips": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The IP list." - } - }, - "description": "Represent the vector location." - }, - "v1SearchConfig": { - "type": "object", - "properties": { - "requestId": { - "type": "string", - "description": "Unique request ID." - }, - "num": { - "type": "integer", - "format": "int64", - "description": "Maximum number of result to be returned." - }, - "radius": { - "type": "number", - "format": "float", - "description": "Search radius." - }, - "epsilon": { - "type": "number", - "format": "float", - "description": "Search coefficient." - }, - "timeout": { - "type": "string", - "format": "int64", - "description": "Search timeout in nanoseconds." - }, - "ingressFilters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Ingress filter configurations." - }, - "egressFilters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Egress filter configurations." - }, - "minNum": { - "type": "integer", - "format": "int64", - "description": "Minimum number of result to be returned." - } - }, - "description": "Represent search configuration." - }, - "v1SearchMultiObjectRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1SearchObjectRequest" - }, - "description": "Represent the multiple search by binary object request content." - } - }, - "description": "Represent the multiple search by binary object request." - }, - "v1SearchObjectRequest": { - "type": "object", - "properties": { - "object": { - "type": "string", - "format": "byte", - "description": "The binary object to be searched." - }, - "config": { - "$ref": "#/definitions/v1SearchConfig", - "description": "The configuration of the search request." - }, - "vectorizer": { - "$ref": "#/definitions/FilterTarget", - "description": "Filter configuration." - } - }, - "description": "Represent a search by binary object request." - }, - "v1UpdateConfig": { - "type": "object", - "properties": { - "skipStrictExistCheck": { - "type": "boolean", - "description": "A flag to skip exist check during update operation." - }, - "filters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Filter configuration." - }, - "timestamp": { - "type": "string", - "format": "int64", - "description": "Update timestamp." - } - }, - "description": "Represent the update configuration." - }, - "v1UpdateMultiObjectRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1UpdateObjectRequest" - }, - "description": "Represent the multiple update object request content." - } - }, - "description": "Represent the multiple update binary object request." - }, - "v1UpdateObjectRequest": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/ObjectBlob", - "description": "The binary object to be updated." - }, - "config": { - "$ref": "#/definitions/v1UpdateConfig", - "description": "The configuration of the update request." - }, - "vectorizer": { - "$ref": "#/definitions/FilterTarget", - "description": "Filter target." - } - }, - "description": "Represent the update binary object request." - }, - "v1UpsertConfig": { - "type": "object", - "properties": { - "skipStrictExistCheck": { - "type": "boolean", - "description": "A flag to skip exist check during upsert operation." - }, - "filters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Filter configuration." - }, - "timestamp": { - "type": "string", - "format": "int64", - "description": "Upsert timestamp." - } - }, - "description": "Represent the upsert configuration." - }, - "v1UpsertMultiObjectRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1UpsertObjectRequest" - }, - "description": "Represent the multiple upsert object request content." - } - }, - "description": "Represent the multiple upsert binary object request." - }, - "v1UpsertObjectRequest": { - "type": "object", - "properties": { - "object": { - "$ref": "#/definitions/ObjectBlob", - "description": "The binary object to be upserted." - }, - "config": { - "$ref": "#/definitions/v1UpsertConfig", - "description": "The configuration of the upsert request." - }, - "vectorizer": { - "$ref": "#/definitions/FilterTarget", - "description": "Filter target." - } - }, - "description": "Represent the upsert binary object request." - } - } -} diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json deleted file mode 100644 index fe029df9c6..0000000000 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/insert.swagger.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/vald/insert.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/insert": { - "post": { - "summary": "A method to add a new single vector.", - "operationId": "Insert_Insert", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ObjectLocation" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1InsertRequest" - } - } - ], - "tags": [ - "Insert" - ] - } - }, - "/insert/multiple": { - "post": { - "summary": "A method to add new multiple vectors in a single request.", - "operationId": "Insert_MultiInsert", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectLocations" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1InsertMultiRequest" - } - } - ], - "tags": [ - "Insert" - ] - } - } - }, - "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, - "ObjectLocations": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "$ref": "#/definitions/v1ObjectLocation" - } - } - }, - "description": "Represent multiple vector locations." - }, - "ObjectStreamLocation": { - "type": "object", - "properties": { - "location": { - "$ref": "#/definitions/v1ObjectLocation", - "description": "The vector location." - }, - "status": { - "$ref": "#/definitions/rpcStatus", - "description": "The RPC error status." - } - }, - "description": "Represent the stream response of the vector location." - }, - "ObjectVector": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "vector": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "description": "The vector." - } - }, - "description": "Represent a vector." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpcCode": { - "type": "integer", - "format": "int32" - }, - "httpCode": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "httpStatus": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1FilterConfig": { - "type": "object", - "properties": { - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/FilterTarget" - }, - "description": "Represent the filter target configuration." - } - }, - "description": "Represent filter configuration." - }, - "v1InsertConfig": { - "type": "object", - "properties": { - "skipStrictExistCheck": { - "type": "boolean", - "description": "A flag to skip exist check during insert operation." - }, - "filters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Filter configurations." - }, - "timestamp": { - "type": "string", - "format": "int64", - "description": "Insert timestamp." - } - }, - "description": "Represent insert configurations." - }, - "v1InsertMultiRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1InsertRequest" - }, - "description": "Represent multiple insert request content." - } - }, - "description": "Represent the multiple insert request." - }, - "v1InsertRequest": { - "type": "object", - "properties": { - "vector": { - "$ref": "#/definitions/ObjectVector", - "description": "The vector to be inserted." - }, - "config": { - "$ref": "#/definitions/v1InsertConfig", - "description": "The configuration of the insert request." - } - }, - "description": "Represent the insert request." - }, - "v1ObjectLocation": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the location." - }, - "uuid": { - "type": "string", - "description": "The UUID of the vector." - }, - "ips": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The IP list." - } - }, - "description": "Represent the vector location." - } - } -} diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json deleted file mode 100644 index 6772a8fb88..0000000000 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/object.swagger.json +++ /dev/null @@ -1,231 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/vald/object.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/exists/{id}": { - "get": { - "summary": "A method to check whether a specified ID is indexed or not.", - "operationId": "Object_Exists", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectID" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Object" - ] - } - }, - "/object/{id.id}": { - "get": { - "summary": "A method to fetch a vector.", - "operationId": "Object_GetObject", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectVector" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "id.id", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Object" - ] - } - } - }, - "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, - "ObjectID": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "description": "Represent the vector ID." - }, - "ObjectStreamVector": { - "type": "object", - "properties": { - "vector": { - "$ref": "#/definitions/ObjectVector", - "description": "The vector." - }, - "status": { - "$ref": "#/definitions/rpcStatus", - "description": "The RPC error status." - } - }, - "description": "Represent stream response of the vector." - }, - "ObjectVector": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "vector": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "description": "The vector." - } - }, - "description": "Represent a vector." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpcCode": { - "type": "integer", - "format": "int32" - }, - "httpCode": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "httpStatus": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1FilterConfig": { - "type": "object", - "properties": { - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/FilterTarget" - }, - "description": "Represent the filter target configuration." - } - }, - "description": "Represent filter configuration." - } - } -} diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json deleted file mode 100644 index d9a073bb76..0000000000 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/remove.swagger.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/vald/remove.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/remove": { - "post": { - "summary": "A method to remove an indexed vector.", - "operationId": "Remove_Remove", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ObjectLocation" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1RemoveRequest" - } - } - ], - "tags": [ - "Remove" - ] - } - }, - "/remove/multiple": { - "post": { - "summary": "A method to remove multiple indexed vectors in a single request.", - "operationId": "Remove_MultiRemove", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectLocations" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1RemoveMultiRequest" - } - } - ], - "tags": [ - "Remove" - ] - } - } - }, - "definitions": { - "ObjectID": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - }, - "description": "Represent the vector ID." - }, - "ObjectLocations": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "$ref": "#/definitions/v1ObjectLocation" - } - } - }, - "description": "Represent multiple vector locations." - }, - "ObjectStreamLocation": { - "type": "object", - "properties": { - "location": { - "$ref": "#/definitions/v1ObjectLocation", - "description": "The vector location." - }, - "status": { - "$ref": "#/definitions/rpcStatus", - "description": "The RPC error status." - } - }, - "description": "Represent the stream response of the vector location." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpcCode": { - "type": "integer", - "format": "int32" - }, - "httpCode": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "httpStatus": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1ObjectLocation": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the location." - }, - "uuid": { - "type": "string", - "description": "The UUID of the vector." - }, - "ips": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The IP list." - } - }, - "description": "Represent the vector location." - }, - "v1RemoveConfig": { - "type": "object", - "properties": { - "skipStrictExistCheck": { - "type": "boolean", - "description": "A flag to skip exist check during upsert operation." - }, - "timestamp": { - "type": "string", - "format": "int64", - "description": "Remove timestamp." - } - }, - "description": "Represent the remove configuration." - }, - "v1RemoveMultiRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1RemoveRequest" - }, - "description": "Represent the multiple remove request content." - } - }, - "description": "Represent the multiple remove request." - }, - "v1RemoveRequest": { - "type": "object", - "properties": { - "id": { - "$ref": "#/definitions/ObjectID", - "description": "The object ID to be removed." - }, - "config": { - "$ref": "#/definitions/v1RemoveConfig", - "description": "The configuration of the remove request." - } - }, - "description": "Represent the remove request." - } - } -} diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json deleted file mode 100644 index 8e632bc896..0000000000 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/search.swagger.json +++ /dev/null @@ -1,552 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/vald/search.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/linearsearch": { - "post": { - "summary": "A method to linear search indexed vectors by a raw vector.", - "operationId": "Search_LinearSearch", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1SearchRequest" - } - } - ], - "tags": [ - "Search" - ] - } - }, - "/linearsearch/id": { - "post": { - "summary": "A method to linear search indexed vectors by ID.", - "operationId": "Search_LinearSearchByID", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SearchIDRequest" - } - } - ], - "tags": [ - "Search" - ] - } - }, - "/linearsearch/id/multiple": { - "post": { - "summary": "A method to linear search indexed vectors by multiple IDs in a single request.", - "operationId": "Search_MultiLinearSearchByID", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponses" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SearchMultiIDRequest" - } - } - ], - "tags": [ - "Search" - ] - } - }, - "/linearsearch/multiple": { - "post": { - "summary": "A method to linear search indexed vectors by multiple vectors in a single request.", - "operationId": "Search_MultiLinearSearch", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponses" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1SearchMultiRequest" - } - } - ], - "tags": [ - "Search" - ] - } - }, - "/search": { - "post": { - "summary": "A method to search indexed vectors by a raw vector.", - "operationId": "Search_Search", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1SearchRequest" - } - } - ], - "tags": [ - "Search" - ] - } - }, - "/search/id": { - "post": { - "summary": "A method to search indexed vectors by ID.", - "operationId": "Search_SearchByID", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SearchIDRequest" - } - } - ], - "tags": [ - "Search" - ] - } - }, - "/search/id/multiple": { - "post": { - "summary": "A method to search indexed vectors by multiple IDs in a single request.", - "operationId": "Search_MultiSearchByID", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponses" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SearchMultiIDRequest" - } - } - ], - "tags": [ - "Search" - ] - } - }, - "/search/multiple": { - "post": { - "summary": "A method to search indexed vectors by multiple vectors in a single request.", - "operationId": "Search_MultiSearch", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/SearchResponses" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1SearchMultiRequest" - } - } - ], - "tags": [ - "Search" - ] - } - } - }, - "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, - "ObjectDistance": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "distance": { - "type": "number", - "format": "float", - "description": "The distance." - } - }, - "description": "Represent the ID and distance pair." - }, - "SearchIDRequest": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID to be searched." - }, - "config": { - "$ref": "#/definitions/v1SearchConfig", - "description": "The configuration of the search request." - } - }, - "description": "Represent a search by ID request." - }, - "SearchMultiIDRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/SearchIDRequest" - }, - "description": "Represent the multiple search by ID request content." - } - }, - "description": "Represent the multiple search by ID request." - }, - "SearchResponse": { - "type": "object", - "properties": { - "requestId": { - "type": "string", - "description": "The unique request ID." - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/ObjectDistance" - }, - "description": "Search results." - } - }, - "description": "Represent a search response." - }, - "SearchResponses": { - "type": "object", - "properties": { - "responses": { - "type": "array", - "items": { - "$ref": "#/definitions/SearchResponse" - }, - "description": "Represent the multiple search response content." - } - }, - "description": "Represent multiple search responses." - }, - "SearchStreamResponse": { - "type": "object", - "properties": { - "response": { - "$ref": "#/definitions/SearchResponse", - "description": "Represent the search response." - }, - "status": { - "$ref": "#/definitions/rpcStatus", - "description": "The RPC error status." - } - }, - "description": "Represent stream search response." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpcCode": { - "type": "integer", - "format": "int32" - }, - "httpCode": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "httpStatus": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1FilterConfig": { - "type": "object", - "properties": { - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/FilterTarget" - }, - "description": "Represent the filter target configuration." - } - }, - "description": "Represent filter configuration." - }, - "v1SearchConfig": { - "type": "object", - "properties": { - "requestId": { - "type": "string", - "description": "Unique request ID." - }, - "num": { - "type": "integer", - "format": "int64", - "description": "Maximum number of result to be returned." - }, - "radius": { - "type": "number", - "format": "float", - "description": "Search radius." - }, - "epsilon": { - "type": "number", - "format": "float", - "description": "Search coefficient." - }, - "timeout": { - "type": "string", - "format": "int64", - "description": "Search timeout in nanoseconds." - }, - "ingressFilters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Ingress filter configurations." - }, - "egressFilters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Egress filter configurations." - }, - "minNum": { - "type": "integer", - "format": "int64", - "description": "Minimum number of result to be returned." - } - }, - "description": "Represent search configuration." - }, - "v1SearchMultiRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1SearchRequest" - }, - "description": "Represent the multiple search request content." - } - }, - "description": "Represent the multiple search request." - }, - "v1SearchRequest": { - "type": "object", - "properties": { - "vector": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "description": "The vector to be searched." - }, - "config": { - "$ref": "#/definitions/v1SearchConfig", - "description": "The configuration of the search request." - } - }, - "description": "Represent a search request." - } - } -} diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json deleted file mode 100644 index 0fe500869b..0000000000 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/update.swagger.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/vald/update.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/update": { - "post": { - "summary": "A method to update an indexed vector.", - "operationId": "Update_Update", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ObjectLocation" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpdateRequest" - } - } - ], - "tags": [ - "Update" - ] - } - }, - "/update/multiple": { - "post": { - "summary": "A method to update multiple indexed vectors in a single request.", - "operationId": "Update_MultiUpdate", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectLocations" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpdateMultiRequest" - } - } - ], - "tags": [ - "Update" - ] - } - } - }, - "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, - "ObjectLocations": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "$ref": "#/definitions/v1ObjectLocation" - } - } - }, - "description": "Represent multiple vector locations." - }, - "ObjectStreamLocation": { - "type": "object", - "properties": { - "location": { - "$ref": "#/definitions/v1ObjectLocation", - "description": "The vector location." - }, - "status": { - "$ref": "#/definitions/rpcStatus", - "description": "The RPC error status." - } - }, - "description": "Represent the stream response of the vector location." - }, - "ObjectVector": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "vector": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "description": "The vector." - } - }, - "description": "Represent a vector." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpcCode": { - "type": "integer", - "format": "int32" - }, - "httpCode": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "httpStatus": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1FilterConfig": { - "type": "object", - "properties": { - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/FilterTarget" - }, - "description": "Represent the filter target configuration." - } - }, - "description": "Represent filter configuration." - }, - "v1ObjectLocation": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the location." - }, - "uuid": { - "type": "string", - "description": "The UUID of the vector." - }, - "ips": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The IP list." - } - }, - "description": "Represent the vector location." - }, - "v1UpdateConfig": { - "type": "object", - "properties": { - "skipStrictExistCheck": { - "type": "boolean", - "description": "A flag to skip exist check during update operation." - }, - "filters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Filter configuration." - }, - "timestamp": { - "type": "string", - "format": "int64", - "description": "Update timestamp." - } - }, - "description": "Represent the update configuration." - }, - "v1UpdateMultiRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1UpdateRequest" - }, - "description": "Represent the multiple update request content." - } - }, - "description": "Represent the multiple update request." - }, - "v1UpdateRequest": { - "type": "object", - "properties": { - "vector": { - "$ref": "#/definitions/ObjectVector", - "description": "The vector to be updated." - }, - "config": { - "$ref": "#/definitions/v1UpdateConfig", - "description": "The configuration of the update request." - } - }, - "description": "Represent the update request." - } - } -} diff --git a/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json b/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json deleted file mode 100644 index 2c89922b2c..0000000000 --- a/apis/swagger/v1/vald/apis/proto/v1/vald/upsert.swagger.json +++ /dev/null @@ -1,305 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "apis/proto/v1/vald/upsert.proto", - "version": "version not set" - }, - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/upsert": { - "post": { - "summary": "A method to insert/update a vector.", - "operationId": "Upsert_Upsert", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/v1ObjectLocation" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpsertRequest" - } - } - ], - "tags": [ - "Upsert" - ] - } - }, - "/upsert/multiple": { - "post": { - "summary": "A method to insert/update multiple vectors in a single request.", - "operationId": "Upsert_MultiUpsert", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/ObjectLocations" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/runtimeError" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/v1UpsertMultiRequest" - } - } - ], - "tags": [ - "Upsert" - ] - } - } - }, - "definitions": { - "FilterTarget": { - "type": "object", - "properties": { - "host": { - "type": "string", - "description": "The target hostname." - }, - "port": { - "type": "integer", - "format": "int64", - "description": "The target port." - } - }, - "description": "Represent the target filter server." - }, - "ObjectLocations": { - "type": "object", - "properties": { - "locations": { - "type": "array", - "items": { - "$ref": "#/definitions/v1ObjectLocation" - } - } - }, - "description": "Represent multiple vector locations." - }, - "ObjectStreamLocation": { - "type": "object", - "properties": { - "location": { - "$ref": "#/definitions/v1ObjectLocation", - "description": "The vector location." - }, - "status": { - "$ref": "#/definitions/rpcStatus", - "description": "The RPC error status." - } - }, - "description": "Represent the stream response of the vector location." - }, - "ObjectVector": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The vector ID." - }, - "vector": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "description": "The vector." - } - }, - "description": "Represent a vector." - }, - "protobufAny": { - "type": "object", - "properties": { - "typeUrl": { - "type": "string", - "description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics." - }, - "value": { - "type": "string", - "format": "byte", - "description": "Must be a valid serialized protocol buffer of the above specified type." - } - }, - "description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }" - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]." - }, - "message": { - "type": "string", - "description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - }, - "description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use." - } - }, - "description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)." - }, - "runtimeError": { - "type": "object", - "properties": { - "error": { - "type": "string" - }, - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "runtimeStreamError": { - "type": "object", - "properties": { - "grpcCode": { - "type": "integer", - "format": "int32" - }, - "httpCode": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "httpStatus": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "v1FilterConfig": { - "type": "object", - "properties": { - "targets": { - "type": "array", - "items": { - "$ref": "#/definitions/FilterTarget" - }, - "description": "Represent the filter target configuration." - } - }, - "description": "Represent filter configuration." - }, - "v1ObjectLocation": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the location." - }, - "uuid": { - "type": "string", - "description": "The UUID of the vector." - }, - "ips": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The IP list." - } - }, - "description": "Represent the vector location." - }, - "v1UpsertConfig": { - "type": "object", - "properties": { - "skipStrictExistCheck": { - "type": "boolean", - "description": "A flag to skip exist check during upsert operation." - }, - "filters": { - "$ref": "#/definitions/v1FilterConfig", - "description": "Filter configuration." - }, - "timestamp": { - "type": "string", - "format": "int64", - "description": "Upsert timestamp." - } - }, - "description": "Represent the upsert configuration." - }, - "v1UpsertMultiRequest": { - "type": "object", - "properties": { - "requests": { - "type": "array", - "items": { - "$ref": "#/definitions/v1UpsertRequest" - }, - "description": "Represent the multiple upsert request content." - } - }, - "description": "Represent mthe ultiple upsert request." - }, - "v1UpsertRequest": { - "type": "object", - "properties": { - "vector": { - "$ref": "#/definitions/ObjectVector", - "description": "The vector to be upserted." - }, - "config": { - "$ref": "#/definitions/v1UpsertConfig", - "description": "The configuration of the upsert request." - } - }, - "description": "Represent the upsert request." - } - } -} diff --git a/charts/vald/templates/agent/hpa.yaml b/charts/vald/templates/agent/hpa.yaml index f07c4bbcf6..e5d565e7d1 100644 --- a/charts/vald/templates/agent/hpa.yaml +++ b/charts/vald/templates/agent/hpa.yaml @@ -15,7 +15,7 @@ # {{- $agent := .Values.agent -}} {{- if and $agent.enabled $agent.hpa.enabled }} -apiVersion: autoscaling/v1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ $agent.name }} @@ -27,12 +27,18 @@ metadata: app.kubernetes.io/version: {{ .Chart.Version }} app.kubernetes.io/component: agent spec: - maxReplicas: {{ $agent.maxReplicas }} - minReplicas: {{ $agent.minReplicas }} scaleTargetRef: apiVersion: apps/v1 kind: {{ $agent.kind }} name: {{ $agent.name }} - targetCPUUtilizationPercentage: {{ $agent.hpa.targetCPUUtilizationPercentage }} + maxReplicas: {{ $agent.maxReplicas }} + minReplicas: {{ $agent.minReplicas }} + metrics: + - type: PodResource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ $agent.hpa.targetCPUUtilizationPercentage }} status: {{- end }} diff --git a/charts/vald/templates/discoverer/hpa.yaml b/charts/vald/templates/discoverer/hpa.yaml index cfe79f8e57..df955c77ff 100644 --- a/charts/vald/templates/discoverer/hpa.yaml +++ b/charts/vald/templates/discoverer/hpa.yaml @@ -15,7 +15,7 @@ # {{- $discoverer := .Values.discoverer -}} {{- if $discoverer.hpa.enabled }} -apiVersion: autoscaling/v1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ $discoverer.name }} @@ -27,12 +27,18 @@ metadata: app.kubernetes.io/version: {{ .Chart.Version }} app.kubernetes.io/component: discoverer spec: - maxReplicas: {{ $discoverer.maxReplicas }} - minReplicas: {{ $discoverer.minReplicas }} scaleTargetRef: apiVersion: apps/v1 kind: {{ $discoverer.kind }} name: {{ $discoverer.name }} - targetCPUUtilizationPercentage: {{ $discoverer.hpa.targetCPUUtilizationPercentage }} + maxReplicas: {{ $discoverer.maxReplicas }} + minReplicas: {{ $discoverer.minReplicas }} + metrics: + - type: PodResource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ $discoverer.hpa.targetCPUUtilizationPercentage }} status: {{- end }} diff --git a/charts/vald/values.go b/charts/vald/values.go index 81878140c8..48c214cc84 100644 --- a/charts/vald/values.go +++ b/charts/vald/values.go @@ -17,14 +17,14 @@ package vald import ( "github.com/vdaas/vald/internal/config" + corev1 "k8s.io/api/core/v1" ) // Affinity -type Affinity struct { - NodeAffinity *NodeAffinity `json:"nodeAffinity,omitempty"` - PodAffinity *PodAffinity `json:"podAffinity,omitempty"` - PodAntiAffinity *PodAntiAffinity `json:"podAntiAffinity,omitempty"` -} +type Affinity corev1.Affinity + +// Annotations deployment annotations +type Annotations map[string]string // Agent type Agent struct { @@ -37,12 +37,12 @@ type Agent struct { Enabled bool `json:"enabled,omitempty"` // environment variables - Env []*EnvItems `json:"env,omitempty"` + Env []corev1.EnvVar `json:"env,omitempty"` // external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local - ExternalTrafficPolicy string `json:"externalTrafficPolicy,omitempty"` - Hpa *Hpa `json:"hpa,omitempty"` - Image *Image `json:"image,omitempty"` + ExternalTrafficPolicy corev1.ServiceExternalTrafficPolicyType `json:"externalTrafficPolicy,omitempty"` + Hpa *Hpa `json:"hpa,omitempty"` + Image *Image `json:"image,omitempty"` // init containers InitContainers []*InitContainersItems `json:"initContainers,omitempty"` @@ -73,7 +73,7 @@ type Agent struct { PersistentVolume *PersistentVolume `json:"persistentVolume,omitempty"` // pod annotations - PodAnnotations *PodAnnotations `json:"podAnnotations,omitempty"` + PodAnnotations *Annotations `json:"podAnnotations,omitempty"` // pod management policy: OrderedReady or Parallel PodManagementPolicy string `json:"podManagementPolicy,omitempty"` @@ -123,20 +123,6 @@ type Agent struct { Volumes []*VolumesItems `json:"volumes,omitempty"` } -// Annotations deployment annotations -type Annotations map[string]string - -// BlobStorage -type BlobStorage struct { - // bucket name - Bucket string `json:"bucket,omitempty"` - CloudStorage *CloudStorage `json:"cloud_storage,omitempty"` - S3 *S3 `json:"s3,omitempty"` - - // storage type - StorageType string `json:"storage_type,omitempty"` -} - // CloudStorage type CloudStorage struct { Client *config.GRPCClient `json:"client,omitempty"` @@ -189,13 +175,7 @@ type Collector struct { } // Compress -type Compress struct { - // compression algorithm. must be `gob`, `gzip`, `lz4` or `zstd` - CompressAlgorithm string `json:"compress_algorithm,omitempty"` - - // compression level. value range relies on which algorithm is used. `gob`: level will be ignored. `gzip`: -1 (default compression), 0 (no compression), or 1 (best speed) to 9 (best compression). `lz4`: >= 0, higher is better compression. `zstd`: 1 (fastest) to 22 (best), however implementation relies on klauspost/compress. - CompressionLevel int `json:"compression_level,omitempty"` -} +type Compress config.CompressCore // Config type Config struct { @@ -204,7 +184,7 @@ type Config struct { // auto backup triggered by timer is enabled AutoBackupEnabled bool `json:"auto_backup_enabled,omitempty"` - BlobStorage *BlobStorage `json:"blob_storage,omitempty"` + BlobStorage *config.Blob `json:"blob_storage,omitempty"` Client *config.GRPCClient `json:"client,omitempty"` Compress *Compress `json:"compress,omitempty"` @@ -282,9 +262,6 @@ type EgressFilter struct { ObjectFilters []string `json:"object_filters,omitempty"` } -// EnvItems -type EnvItems struct{} - // Exporter type Exporter struct { // how many view data events or trace spans can be buffered. @@ -326,6 +303,8 @@ type Fields struct{} // Filter type Filter struct { + config.GlobalConfig + Affinity *Affinity `json:"affinity,omitempty"` // deployment annotations @@ -335,7 +314,7 @@ type Filter struct { Enabled bool `json:"enabled,omitempty"` // environment variables - Env []*EnvItems `json:"env,omitempty"` + Env []corev1.EnvVar `json:"env,omitempty"` // external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local ExternalTrafficPolicy string `json:"externalTrafficPolicy,omitempty"` @@ -348,8 +327,7 @@ type Filter struct { InitContainers []*InitContainersItems `json:"initContainers,omitempty"` // deployment kind: Deployment or DaemonSet - Kind string `json:"kind,omitempty"` - Logging *Logging `json:"logging,omitempty"` + Kind string `json:"kind,omitempty"` // maximum number of replicas. if HPA is disabled, this value will be ignored. MaxReplicas int `json:"maxReplicas,omitempty"` @@ -398,9 +376,6 @@ type Filter struct { // duration in seconds pod needs to terminate gracefully TerminationGracePeriodSeconds int `json:"terminationGracePeriodSeconds,omitempty"` - // Time zone - TimeZone string `json:"time_zone,omitempty"` - // tolerations Tolerations []*TolerationsItems `json:"tolerations,omitempty"` @@ -521,7 +496,7 @@ type Index struct { Enabled bool `json:"enabled,omitempty"` // environment variables - Env []*EnvItems `json:"env,omitempty"` + Env []corev1.EnvVar `json:"env,omitempty"` // external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local ExternalTrafficPolicy string `json:"externalTrafficPolicy,omitempty"` @@ -735,7 +710,7 @@ type Lb struct { Enabled bool `json:"enabled,omitempty"` // environment variables - Env []*EnvItems `json:"env,omitempty"` + Env []corev1.EnvVar `json:"env,omitempty"` // external traffic policy (can be specified when service type is LoadBalancer or NodePort) : Cluster or Local ExternalTrafficPolicy string `json:"externalTrafficPolicy,omitempty"` @@ -771,8 +746,8 @@ type Lb struct { Observability *Observability `json:"observability,omitempty"` // pod annotations - PodAnnotations *PodAnnotations `json:"podAnnotations,omitempty"` - PodPriority *PodPriority `json:"podPriority,omitempty"` + PodAnnotations *Annotations `json:"podAnnotations,omitempty"` + PodPriority *PodPriority `json:"podPriority,omitempty"` // security context for pod PodSecurityContext *PodSecurityContext `json:"podSecurityContext,omitempty"` @@ -826,8 +801,8 @@ type Liveness struct { Enabled bool `json:"enabled,omitempty"` // liveness server host - Host string `json:"host,omitempty"` - LivenessProbe *LivenessProbe `json:"livenessProbe,omitempty"` + Host string `json:"host,omitempty"` + LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty"` // liveness server port Port int `json:"port,omitempty"` @@ -837,25 +812,6 @@ type Liveness struct { ServicePort int `json:"servicePort,omitempty"` } -// LivenessProbe -type LivenessProbe struct { - // liveness probe failure threshold - FailureThreshold int `json:"failureThreshold,omitempty"` - HttpGet *HttpGet `json:"httpGet,omitempty"` - - // liveness probe initial delay seconds - InitialDelaySeconds int `json:"initialDelaySeconds,omitempty"` - - // liveness probe period seconds - PeriodSeconds int `json:"periodSeconds,omitempty"` - - // liveness probe success threshold - SuccessThreshold int `json:"successThreshold,omitempty"` - - // liveness probe timeout seconds - TimeoutSeconds int `json:"timeoutSeconds,omitempty"` -} - // Logging type Logging struct { // logging format. logging format must be `raw` or `json` @@ -899,13 +855,6 @@ type Node struct { Labels *Labels `json:"labels,omitempty"` } -// NodeAffinity -type NodeAffinity struct { - // node affinity preferred scheduling terms - PreferredDuringSchedulingIgnoredDuringExecution []*PreferredDuringSchedulingIgnoredDuringExecutionItems `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` - RequiredDuringSchedulingIgnoredDuringExecution *RequiredDuringSchedulingIgnoredDuringExecution `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` -} - // NodeMetrics k8s resource selectors for node_metrics discovery type NodeMetrics struct { // k8s field selectors for node_metrics discovery @@ -957,27 +906,9 @@ type Pod struct { Labels *Labels `json:"labels,omitempty"` } -// PodAffinity -type PodAffinity struct { - // pod affinity preferred scheduling terms - PreferredDuringSchedulingIgnoredDuringExecution []*PreferredDuringSchedulingIgnoredDuringExecutionItems `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` - - // pod affinity required scheduling terms - RequiredDuringSchedulingIgnoredDuringExecution []*RequiredDuringSchedulingIgnoredDuringExecutionItems `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` -} - // PodAnnotations pod annotations type PodAnnotations struct{} -// PodAntiAffinity -type PodAntiAffinity struct { - // pod anti-affinity preferred scheduling terms - PreferredDuringSchedulingIgnoredDuringExecution []*PreferredDuringSchedulingIgnoredDuringExecutionItems `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` - - // pod anti-affinity required scheduling terms - RequiredDuringSchedulingIgnoredDuringExecution []*RequiredDuringSchedulingIgnoredDuringExecutionItems `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` -} - // PodMetrics k8s resource selectors for pod_metrics discovery type PodMetrics struct { // k8s field selectors for pod_metrics discovery @@ -1081,33 +1012,14 @@ type Readiness struct { Host string `json:"host,omitempty"` // readiness server port - Port int `json:"port,omitempty"` - ReadinessProbe *ReadinessProbe `json:"readinessProbe,omitempty"` - Server *Server `json:"server,omitempty"` + Port int `json:"port,omitempty"` + ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty"` + Server *Server `json:"server,omitempty"` // readiness server service port ServicePort int `json:"servicePort,omitempty"` } -// ReadinessProbe -type ReadinessProbe struct { - // readiness probe failure threshold - FailureThreshold int `json:"failureThreshold,omitempty"` - HttpGet *HttpGet `json:"httpGet,omitempty"` - - // readiness probe initial delay seconds - InitialDelaySeconds int `json:"initialDelaySeconds,omitempty"` - - // readiness probe period seconds - PeriodSeconds int `json:"periodSeconds,omitempty"` - - // readiness probe success threshold - SuccessThreshold int `json:"successThreshold,omitempty"` - - // readiness probe timeout seconds - TimeoutSeconds int `json:"timeoutSeconds,omitempty"` -} - // Requests type Requests struct{} @@ -1286,8 +1198,8 @@ type Sidecar struct { Enabled bool `json:"enabled,omitempty"` // environment variables - Env []*EnvItems `json:"env,omitempty"` - Image *Image `json:"image,omitempty"` + Env []corev1.EnvVar `json:"env,omitempty"` + Image *Image `json:"image,omitempty"` // sidecar on initContainer mode enabled. InitContainerEnabled bool `json:"initContainerEnabled,omitempty"` diff --git a/docs/user-guides/configuration.md b/docs/user-guides/configuration.md index 00f9e1c35e..9853ed8bc8 100644 --- a/docs/user-guides/configuration.md +++ b/docs/user-guides/configuration.md @@ -95,7 +95,7 @@ The API specs are placed in [apis/docs][vald-apis-docs]. ##### REST server REST server is optional. -The swagger specs are placed in [apis/swagger][vald-swagger-specs]. +The openapi specs are placed in [apis/openapi][vald-openapi-specs]. ##### Health check servers @@ -275,7 +275,7 @@ For further details, there are references of Helm values in GitHub Vald reposito [vald-helm-operator-chart]: https://github.com/vdaas/vald/tree/master/charts/vald-helm-operator [vald-apis-docs]: https://github.com/vdaas/vald/tree/master/apis/docs -[vald-swagger-specs]: https://github.com/vdaas/vald/tree/master/apis/swagger +[vald-openapi-specs]: https://github.com/vdaas/vald/tree/master/apis/openapi [google-pprof]: https://github.com/google/pprof [prometheus-io]: https://prometheus.io/ [kubernetes-liveness-readiness]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ diff --git a/example/client/go.mod b/example/client/go.mod index 55adcb10a7..b151a8a537 100644 --- a/example/client/go.mod +++ b/example/client/go.mod @@ -21,7 +21,7 @@ replace ( require ( github.com/kpango/fuid v0.0.0-20220209050620-e5987ba1ea5e github.com/kpango/glg v1.6.10 - github.com/vdaas/vald-client-go v1.5.4 + github.com/vdaas/vald-client-go v1.5.5 gonum.org/v1/hdf5 v0.0.0-20210714002203-8c5d23bc6946 google.golang.org/grpc v1.47.0 ) @@ -31,9 +31,9 @@ require ( github.com/goccy/go-json v0.9.7 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/kpango/fastime v1.1.4 // indirect - golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20211104193956-4c6863e31247 // indirect + google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90 // indirect google.golang.org/protobuf v1.28.0 // indirect ) diff --git a/example/client/go.sum b/example/client/go.sum index d739e697c9..6fa35b55b7 100644 --- a/example/client/go.sum +++ b/example/client/go.sum @@ -43,8 +43,8 @@ github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/vdaas/vald-client-go v1.5.4 h1:KfEQu/ITCOIo0GQyGp/Zjah2hKQ+ugFDd2S7WTBfdgs= -github.com/vdaas/vald-client-go v1.5.4/go.mod h1:Pix3iSVKf7Ml6oaVtk9CXHNyJDQEWZaTLeQJGSxtTrc= +github.com/vdaas/vald-client-go v1.5.5 h1:ojvNSVvJyY5UBWbzaRyh5nG/EU5ur21uPiK//+g6cyE= +github.com/vdaas/vald-client-go v1.5.5/go.mod h1:8jQGD5r4q9edv6iH6NjcBEBIw++uhRhhHicS/oSOmwo= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= @@ -68,8 +68,9 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d h1:Zu/JngovGLVi6t2J3nmAf3AoTDwuzw85YZ3b9o4yU7s= +golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= diff --git a/go.mod b/go.mod index 4f19cae80a..dca730bcd3 100755 --- a/go.mod +++ b/go.mod @@ -316,7 +316,7 @@ replace ( github.com/julienschmidt/httprouter => github.com/julienschmidt/httprouter v1.3.0 github.com/kisielk/errcheck => github.com/kisielk/errcheck v1.6.1 github.com/kisielk/gotool => github.com/kisielk/gotool v1.0.0 - github.com/klauspost/compress => github.com/klauspost/compress v1.15.8-0.20220629100200-fa9e24a4d761 + github.com/klauspost/compress => github.com/klauspost/compress v1.15.8-0.20220704071608-bf3f0fddbe56 github.com/klauspost/cpuid/v2 => github.com/klauspost/cpuid/v2 v2.0.14 github.com/kolo/xmlrpc => github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b github.com/kpango/fastime => github.com/kpango/fastime v1.1.4 @@ -449,7 +449,7 @@ replace ( github.com/ugorji/go => github.com/ugorji/go v1.2.7 github.com/ugorji/go/codec => github.com/ugorji/go/codec v1.2.7 github.com/urfave/cli => github.com/urfave/cli v1.22.9 - github.com/vdaas/vald-client-go => github.com/vdaas/vald-client-go v1.5.4 + github.com/vdaas/vald-client-go => github.com/vdaas/vald-client-go v1.5.5 github.com/vishvananda/netlink => github.com/vishvananda/netlink v1.1.0 github.com/vishvananda/netns => github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 github.com/xdg-go/pbkdf2 => github.com/xdg-go/pbkdf2 v1.0.0 @@ -507,7 +507,7 @@ replace ( golang.org/x/net => golang.org/x/net v0.0.0-20220630215102-69896b714898 golang.org/x/oauth2 => golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 golang.org/x/sync => golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f - golang.org/x/sys => golang.org/x/sys v0.0.0-20220702020025-31831981b65f + golang.org/x/sys => golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e golang.org/x/term => golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 golang.org/x/text => golang.org/x/text v0.3.7 golang.org/x/time => golang.org/x/time v0.0.0-20220609170525-579cf78fd858 diff --git a/go.sum b/go.sum index a9ce28f555..dee1b545e3 100644 --- a/go.sum +++ b/go.sum @@ -506,8 +506,8 @@ github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7 github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8= github.com/kisielk/errcheck v1.6.1/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.15.8-0.20220629100200-fa9e24a4d761 h1:OeVMuXEFU8JCcKuZttfemjVXF0UiS3KGucmSoD149jM= -github.com/klauspost/compress v1.15.8-0.20220629100200-fa9e24a4d761/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= +github.com/klauspost/compress v1.15.8-0.20220704071608-bf3f0fddbe56 h1:Ph/bKTZf6Y8tyW+zR7ySUw9YQ8Aej5bwUmOLjlFgSss= +github.com/klauspost/compress v1.15.8-0.20220704071608-bf3f0fddbe56/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.14 h1:QRqdp6bb9M9S5yyKeYteXKuoKE4p0tGlra81fKOpWH8= github.com/klauspost/cpuid/v2 v2.0.14/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= @@ -754,8 +754,8 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/vbatts/tar-split v0.11.2/go.mod h1:vV3ZuO2yWSVsz+pfFzDG/upWH1JhjOiEaWq6kXyQ3VI= -github.com/vdaas/vald-client-go v1.5.4 h1:KfEQu/ITCOIo0GQyGp/Zjah2hKQ+ugFDd2S7WTBfdgs= -github.com/vdaas/vald-client-go v1.5.4/go.mod h1:Pix3iSVKf7Ml6oaVtk9CXHNyJDQEWZaTLeQJGSxtTrc= +github.com/vdaas/vald-client-go v1.5.5 h1:ojvNSVvJyY5UBWbzaRyh5nG/EU5ur21uPiK//+g6cyE= +github.com/vdaas/vald-client-go v1.5.5/go.mod h1:8jQGD5r4q9edv6iH6NjcBEBIw++uhRhhHicS/oSOmwo= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= @@ -837,8 +837,8 @@ golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 h1:VnGaRqoLmqZH/3TMLJwYCE golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUNbr7Xvw8kYilQ+6qjRY= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e h1:CsOuNlbOuf0mzxJIefr6Q4uAUetRUwZE4qt7VfzP+xo= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 h1:CBpWXWQpIRjzmkkA+M7q9Fqnwd2mZr3AFqexg8YTfoM= golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= diff --git a/internal/config/backup.go b/internal/config/backup.go deleted file mode 100644 index c6e64bcc02..0000000000 --- a/internal/config/backup.go +++ /dev/null @@ -1,33 +0,0 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Package config providers configuration type and load configuration logic -package config - -// BackupManager represents the configuration for backup manager. -type BackupManager struct { - Client *GRPCClient `json:"client" yaml:"client"` -} - -// Bind binds the actual data from the BackupManager receiver fields. -func (b *BackupManager) Bind() *BackupManager { - if b.Client != nil { - b.Client = b.Client.Bind() - } else { - b.Client = newGRPCClientConfig() - } - return b -} diff --git a/internal/config/backup_test.go b/internal/config/backup_test.go deleted file mode 100644 index 6794dd3d95..0000000000 --- a/internal/config/backup_test.go +++ /dev/null @@ -1,175 +0,0 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Package config providers configuration type and load configuration logic -package config - -import ( - "reflect" - "testing" - - "github.com/vdaas/vald/internal/errors" - "github.com/vdaas/vald/internal/test/goleak" -) - -func TestBackupManager_Bind(t *testing.T) { - type fields struct { - Client *GRPCClient - } - type want struct { - want *BackupManager - } - type test struct { - name string - fields fields - want want - checkFunc func(want, *BackupManager) error - beforeFunc func() - afterFunc func() - } - defaultCheckFunc := func(w want, got *BackupManager) error { - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - func() test { - addrs := []string{ - "10.40.3.342", - "10.40.98.17", - "10.40.84.215", - } - healthcheck := "30s" - connectionPool := &ConnectionPool{ - ResolveDNS: true, - EnableRebalance: true, - RebalanceDuration: "5m", - Size: 100, - OldConnCloseDuration: "3m", - } - backoffOpts := &Backoff{ - InitialDuration: "5m", - BackoffTimeLimit: "10m", - MaximumDuration: "15m", - JitterLimit: "3m", - BackoffFactor: 3, - RetryCount: 100, - EnableErrorLog: true, - } - callOpts := &CallOption{ - WaitForReady: true, - MaxRetryRPCBufferSize: 100, - MaxRecvMsgSize: 1000, - MaxSendMsgSize: 1000, - } - dialOpts := &DialOption{ - WriteBufferSize: 10000, - ReadBufferSize: 10000, - InitialWindowSize: 100, - InitialConnectionWindowSize: 100, - MaxMsgSize: 1000, - BackoffMaxDelay: "3m", - BackoffBaseDelay: "1m", - BackoffJitter: 100, - BackoffMultiplier: 10, - MinimumConnectionTimeout: "5m", - EnableBackoff: true, - Insecure: true, - Timeout: "5m", - Net: &Net{}, - Keepalive: &GRPCClientKeepalive{ - Time: "100s", - Timeout: "300s", - PermitWithoutStream: true, - }, - } - tls := &TLS{ - Enabled: true, - Cert: "cert", - Key: "key", - CA: "ca", - } - return test{ - name: "return BackupManager when the b.Client is not nil", - fields: fields{ - Client: &GRPCClient{ - Addrs: addrs, - HealthCheckDuration: healthcheck, - ConnectionPool: connectionPool, - Backoff: backoffOpts, - CallOption: callOpts, - DialOption: dialOpts, - TLS: tls, - }, - }, - want: want{ - want: &BackupManager{ - Client: &GRPCClient{ - Addrs: addrs, - HealthCheckDuration: healthcheck, - ConnectionPool: connectionPool, - Backoff: backoffOpts, - CallOption: callOpts, - DialOption: dialOpts, - TLS: tls, - }, - }, - }, - } - }(), - func() test { - return test{ - name: "return BackupManager when the b.Client is nil", - fields: fields{}, - want: want{ - want: &BackupManager{ - Client: &GRPCClient{ - DialOption: &DialOption{ - Insecure: true, - }, - }, - }, - }, - } - }(), - } - - for _, tc := range tests { - test := tc - t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) - if test.beforeFunc != nil { - test.beforeFunc() - } - if test.afterFunc != nil { - defer test.afterFunc() - } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc - } - b := &BackupManager{ - Client: test.fields.Client, - } - - got := b.Bind() - if err := checkFunc(test.want, got); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} diff --git a/internal/config/compress.go b/internal/config/compress.go index 8c92dba1ad..f7bd18ad85 100644 --- a/internal/config/compress.go +++ b/internal/config/compress.go @@ -65,9 +65,11 @@ func CompressAlgorithm(ca string) compressAlgorithm { // CompressCore represents CompressCore configuration. type CompressCore struct { // CompressorAlgorithm represents compression algorithm type + // compression algorithm. must be `gob`, `gzip`, `lz4` or `zstd` CompressAlgorithm string `json:"compress_algorithm" yaml:"compress_algorithm"` // CompressionLevel represents compression level + // compression level. value range relies on which algorithm is used. `gob`: level will be ignored. `gzip`: -1 (default compression), 0 (no compression), or 1 (best speed) to 9 (best compression). `lz4`: >= 0, higher is better compression. `zstd`: 1 (fastest) to 22 (best), however implementation relies on klauspost/compress. CompressionLevel int `json:"compression_level" yaml:"compression_level"` } @@ -77,48 +79,3 @@ func (c *CompressCore) Bind() *CompressCore { return c } - -// Compressor represents Compressor configuration. -type Compressor struct { - CompressCore `json:",inline" yaml:",inline"` - - // ConcurrentLimit represents limitation of compression worker concurrency - ConcurrentLimit int `json:"concurrent_limit" yaml:"concurrent_limit"` - - // QueueCheckDuration represents duration of queue daemon block - QueueCheckDuration string `json:"queue_check_duration" yaml:"queue_check_duration"` -} - -// Bind binds the actual data from the Compressor receiver field. -func (c *Compressor) Bind() *Compressor { - c.CompressCore = *c.CompressCore.Bind() - - c.QueueCheckDuration = GetActualValue(c.QueueCheckDuration) - - return c -} - -// CompressorRegisterer represents CompressorRegisterer configuration. -type CompressorRegisterer struct { - // ConcurrentLimit represents limitation of worker - ConcurrentLimit int `json:"concurrent_limit" yaml:"concurrent_limit"` - - // QueueCheckDuration represents duration of queue daemon block - QueueCheckDuration string `json:"queue_check_duration" yaml:"queue_check_duration"` - - // Compressor represents gRPC client config of compressor client (for forwarding use) - Compressor *BackupManager `json:"compressor" yaml:"compressor"` -} - -// Bind binds the actual data from the CompressorRegisterer receiver field. -func (cr *CompressorRegisterer) Bind() *CompressorRegisterer { - cr.QueueCheckDuration = GetActualValue(cr.QueueCheckDuration) - - if cr.Compressor != nil { - cr.Compressor = cr.Compressor.Bind() - } else { - cr.Compressor = new(BackupManager) - } - - return cr -} diff --git a/internal/config/compress_test.go b/internal/config/compress_test.go index a1677229d3..4117022894 100644 --- a/internal/config/compress_test.go +++ b/internal/config/compress_test.go @@ -357,204 +357,3 @@ func TestCompressCore_Bind(t *testing.T) { }) } } - -func TestCompressor_Bind(t *testing.T) { - type fields struct { - CompressCore CompressCore - ConcurrentLimit int - QueueCheckDuration string - } - type want struct { - want *Compressor - } - type test struct { - name string - fields fields - want want - checkFunc func(want, *Compressor) error - beforeFunc func(*testing.T) - afterFunc func(*testing.T) - } - defaultCheckFunc := func(w want, got *Compressor) error { - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - func() test { - return test{ - name: "return Compressor when the bind successes", - fields: fields{ - QueueCheckDuration: "5ms", - }, - want: want{ - want: &Compressor{ - QueueCheckDuration: "5ms", - }, - }, - } - }(), - func() test { - key := "COMPRESSOR_BIND_QUEUE_CHECK_DURATION" - wantVal := "5ms" - - var cm CompressCore - - return test{ - name: "return Compressor when the bind successes and the data is loaded from the environment variable", - fields: fields{ - QueueCheckDuration: "_" + key + "_", - CompressCore: cm, - }, - beforeFunc: func(t *testing.T) { - t.Helper() - t.Setenv(key, wantVal) - }, - want: want{ - want: &Compressor{ - QueueCheckDuration: "5ms", - CompressCore: cm, - }, - }, - } - }(), - } - - for _, test := range tests { - t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(tt, goleakIgnoreOptions...) - if test.beforeFunc != nil { - test.beforeFunc(tt) - } - if test.afterFunc != nil { - defer test.afterFunc(tt) - } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc - } - c := &Compressor{ - CompressCore: test.fields.CompressCore, - ConcurrentLimit: test.fields.ConcurrentLimit, - QueueCheckDuration: test.fields.QueueCheckDuration, - } - - got := c.Bind() - if err := checkFunc(test.want, got); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} - -func TestCompressorRegisterer_Bind(t *testing.T) { - type fields struct { - ConcurrentLimit int - QueueCheckDuration string - Compressor *BackupManager - } - type want struct { - want *CompressorRegisterer - } - type test struct { - name string - fields fields - want want - checkFunc func(want, *CompressorRegisterer) error - beforeFunc func(*testing.T) - afterFunc func(*testing.T) - } - defaultCheckFunc := func(w want, got *CompressorRegisterer) error { - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - func() test { - return test{ - name: "return CompressorRegisterer when the bind successes", - fields: fields{ - ConcurrentLimit: 10, - QueueCheckDuration: "5ms", - }, - want: want{ - want: &CompressorRegisterer{ - ConcurrentLimit: 10, - QueueCheckDuration: "5ms", - Compressor: new(BackupManager), - }, - }, - } - }(), - func() test { - key := "COMPRESSORREGISTERER_BIND_QUEUE_CHECK_DURATION" - wantVal := "5ms" - - return test{ - name: "return CompressorRegisterer when the bind successes and the data is loaded from the environment variable", - fields: fields{ - ConcurrentLimit: 10, - QueueCheckDuration: "_" + key + "_", - }, - want: want{ - want: &CompressorRegisterer{ - ConcurrentLimit: 10, - QueueCheckDuration: "5ms", - Compressor: new(BackupManager), - }, - }, - beforeFunc: func(t *testing.T) { - t.Helper() - t.Setenv(key, wantVal) - }, - } - }(), - func() test { - bm := new(BackupManager) - - return test{ - name: "return CompressorRegisterer when the bind successes and Compressor is nil", - fields: fields{ - ConcurrentLimit: 10, - QueueCheckDuration: "5ms", - Compressor: bm, - }, - want: want{ - want: &CompressorRegisterer{ - ConcurrentLimit: 10, - QueueCheckDuration: "5ms", - Compressor: bm, - }, - }, - } - }(), - } - - for _, test := range tests { - t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(tt, goleakIgnoreOptions...) - if test.beforeFunc != nil { - test.beforeFunc(tt) - } - if test.afterFunc != nil { - defer test.afterFunc(tt) - } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc - } - cr := &CompressorRegisterer{ - ConcurrentLimit: test.fields.ConcurrentLimit, - QueueCheckDuration: test.fields.QueueCheckDuration, - Compressor: test.fields.Compressor, - } - - got := cr.Bind() - if err := checkFunc(test.want, got); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} diff --git a/internal/config/gateway.go b/internal/config/gateway.go deleted file mode 100644 index 90b0f1245e..0000000000 --- a/internal/config/gateway.go +++ /dev/null @@ -1,78 +0,0 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Package config providers configuration type and load configuration logic -package config - -// Gateway represents the list of configurations for gateway. -type Gateway struct { - // AgentPort represent agent port number - AgentPort int `json:"agent_port" yaml:"agent_port"` - - // AgentName represent agents meta_name for service discovery - AgentName string `json:"agent_name" yaml:"agent_name"` - - // AgentNamespace represent agent namespace location - AgentNamespace string `json:"agent_namespace" yaml:"agent_namespace"` - - // AgentDNS represent agents dns A record for service discovery - AgentDNS string `json:"agent_dns" yaml:"agent_dns"` - - // NodeName represents node name - NodeName string `json:"node_name" yaml:"node_name"` - - // IndexReplica represents index replication count - IndexReplica int `json:"index_replica" yaml:"index_replica"` - - // Discoverer represent agent discoverer service configuration - Discoverer *DiscovererClient `json:"discoverer" yaml:"discoverer"` - - // Meta represent meta data service configuration - Meta *Meta `json:"meta" yaml:"meta"` - - // BackupManager represent backup manager configuration - BackupManager *BackupManager `json:"backup" yaml:"backup"` - - // EgressFilter represents egress filter configuration - EgressFilter *EgressFilter `json:"egress_filter" yaml:"egress_filter"` -} - -// Bind binds the actual data from the Gateway receiver field on the Gateway. -func (g *Gateway) Bind() *Gateway { - g.AgentName = GetActualValue(g.AgentName) - g.AgentNamespace = GetActualValue(g.AgentNamespace) - - g.AgentDNS = GetActualValue(g.AgentDNS) - - g.NodeName = GetActualValue(g.NodeName) - - if g.Discoverer != nil { - g.Discoverer = g.Discoverer.Bind() - } - if g.Meta != nil { - g.Meta = g.Meta.Bind() - } else { - g.Meta = new(Meta) - } - if g.BackupManager != nil { - g.BackupManager = g.BackupManager.Bind() - } - - if g.EgressFilter != nil { - g.EgressFilter = g.EgressFilter.Bind() - } - return g -} diff --git a/internal/config/gateway_test.go b/internal/config/gateway_test.go deleted file mode 100644 index e7a7f0933d..0000000000 --- a/internal/config/gateway_test.go +++ /dev/null @@ -1,255 +0,0 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Package config providers configuration type and load configuration logic -package config - -import ( - "reflect" - "testing" - - "github.com/vdaas/vald/internal/errors" - "github.com/vdaas/vald/internal/test/goleak" -) - -func TestGateway_Bind(t *testing.T) { - type fields struct { - AgentPort int - AgentName string - AgentNamespace string - AgentDNS string - NodeName string - IndexReplica int - Discoverer *DiscovererClient - Meta *Meta - BackupManager *BackupManager - EgressFilter *EgressFilter - } - type want struct { - want *Gateway - } - type test struct { - name string - fields fields - want want - checkFunc func(want, *Gateway) error - beforeFunc func(*testing.T) - afterFunc func(*testing.T) - } - defaultCheckFunc := func(w want, got *Gateway) error { - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - func() test { - port := 8081 - name := "vald-agent-ngt-0" - ns := "vald" - dns := "vald-agent-ngt.vald.svc.local" - node := "vald-prod" - ireplica := 3 - return test{ - name: "return Gateway when only params related agent and dns are set", - fields: fields{ - AgentPort: port, - AgentName: name, - AgentNamespace: ns, - AgentDNS: dns, - NodeName: node, - IndexReplica: ireplica, - }, - want: want{ - want: &Gateway{ - AgentPort: port, - AgentName: name, - AgentNamespace: ns, - AgentDNS: dns, - NodeName: node, - IndexReplica: ireplica, - Meta: &Meta{}, - }, - }, - } - }(), - func() test { - port := 8081 - name := "vald-agent-ngt-0" - ns := "vald" - dns := "vald-agent-ngt.vald.svc.local" - node := "vald-prod" - ireplica := 3 - disc := &DiscovererClient{ - Duration: "10m", - } - meta := &Meta{ - Host: "vald-meta.svc.local", - Port: 8081, - EnableCache: true, - CacheExpiration: "3m", - ExpiredCacheCheckDuration: "10m", - } - bmanager := &BackupManager{} - efilter := &EgressFilter{} - return test{ - name: "return Gateway when all of params are set", - fields: fields{ - AgentPort: port, - AgentName: name, - AgentNamespace: ns, - AgentDNS: dns, - NodeName: node, - IndexReplica: ireplica, - Discoverer: disc, - Meta: meta, - BackupManager: bmanager, - EgressFilter: efilter, - }, - want: want{ - want: &Gateway{ - AgentPort: port, - AgentName: name, - AgentNamespace: ns, - AgentDNS: dns, - NodeName: node, - IndexReplica: ireplica, - Discoverer: &DiscovererClient{ - Duration: "10m", - Client: &GRPCClient{ - DialOption: &DialOption{ - Insecure: true, - }, - }, - AgentClientOptions: &GRPCClient{ - DialOption: &DialOption{ - Insecure: true, - }, - }, - }, - Meta: &Meta{ - Host: "vald-meta.svc.local", - Port: 8081, - Client: &GRPCClient{ - Addrs: []string{ - "vald-meta.svc.local:8081", - }, - DialOption: &DialOption{ - Insecure: true, - }, - }, - EnableCache: true, - CacheExpiration: "3m", - ExpiredCacheCheckDuration: "10m", - }, - BackupManager: &BackupManager{ - Client: &GRPCClient{ - DialOption: &DialOption{ - Insecure: true, - }, - }, - }, - EgressFilter: &EgressFilter{}, - }, - }, - } - }(), - func() test { - envPrefix := "GATEWAY_BIND_" - p := map[string]string{ - envPrefix + "AGENT_NAME": "vald-agent-ngt-0", - envPrefix + "AGENT_NAMESPACE": "vald", - envPrefix + "AGENT_DNS": "vald-agent-ngt.svc.local", - envPrefix + "NODE_NAME": "vald-prod", - } - port := 8081 - ireplica := 3 - return test{ - name: "return Gateway when params set as environment value", - fields: fields{ - AgentPort: port, - AgentName: "_" + envPrefix + "AGENT_NAME_", - AgentNamespace: "_" + envPrefix + "AGENT_NAMESPACE_", - AgentDNS: "_" + envPrefix + "AGENT_DNS_", - NodeName: "_" + envPrefix + "NODE_NAME_", - IndexReplica: ireplica, - }, - beforeFunc: func(t *testing.T) { - t.Helper() - for k, v := range p { - t.Setenv(k, v) - } - }, - want: want{ - want: &Gateway{ - AgentPort: 8081, - AgentName: "vald-agent-ngt-0", - AgentNamespace: "vald", - AgentDNS: "vald-agent-ngt.svc.local", - NodeName: "vald-prod", - IndexReplica: 3, - Meta: &Meta{}, - }, - }, - } - }(), - func() test { - return test{ - name: "return Gateway when all params are not set", - fields: fields{}, - want: want{ - want: &Gateway{ - Meta: &Meta{}, - }, - }, - } - }(), - } - - for _, tc := range tests { - test := tc - t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) - if test.beforeFunc != nil { - test.beforeFunc(tt) - } - if test.afterFunc != nil { - defer test.afterFunc(tt) - } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc - } - g := &Gateway{ - AgentPort: test.fields.AgentPort, - AgentName: test.fields.AgentName, - AgentNamespace: test.fields.AgentNamespace, - AgentDNS: test.fields.AgentDNS, - NodeName: test.fields.NodeName, - IndexReplica: test.fields.IndexReplica, - Discoverer: test.fields.Discoverer, - Meta: test.fields.Meta, - BackupManager: test.fields.BackupManager, - EgressFilter: test.fields.EgressFilter, - } - - got := g.Bind() - if err := checkFunc(test.want, got); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} diff --git a/internal/config/client.go b/internal/config/http.go similarity index 83% rename from internal/config/client.go rename to internal/config/http.go index 6007526ed2..dea94f3ff9 100644 --- a/internal/config/client.go +++ b/internal/config/http.go @@ -14,17 +14,16 @@ // limitations under the License. // -// Package config providers configuration type and load configuration logic package config -// Client represents the Client configurations. -type Client struct { +// HTTPClient represents the HTTPClient configurations. +type HTTPClient struct { Net *Net `json:"net" yaml:"net"` Transport *Transport `json:"transport" yaml:"transport"` } // Bind binds the actual data from the Client receiver field. -func (c *Client) Bind() *Client { +func (c *HTTPClient) Bind() *HTTPClient { if c.Net != nil { c.Net.Bind() } diff --git a/internal/config/client_test.go b/internal/config/http_test.go similarity index 83% rename from internal/config/client_test.go rename to internal/config/http_test.go index 0291a3e122..7828e22317 100644 --- a/internal/config/client_test.go +++ b/internal/config/http_test.go @@ -25,23 +25,23 @@ import ( "github.com/vdaas/vald/internal/test/goleak" ) -func TestClient_Bind(t *testing.T) { +func TestHTTPClient_Bind(t *testing.T) { type fields struct { Net *Net Transport *Transport } type want struct { - want *Client + want *HTTPClient } type test struct { name string fields fields want want - checkFunc func(want, *Client) error + checkFunc func(want, *HTTPClient) error beforeFunc func() afterFunc func() } - defaultCheckFunc := func(w want, got *Client) error { + defaultCheckFunc := func(w want, got *HTTPClient) error { if !reflect.DeepEqual(got, w.want) { return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) } @@ -49,19 +49,19 @@ func TestClient_Bind(t *testing.T) { } tests := []test{ { - name: "return Client when the bind successes and net and transport is nil", + name: "return HTTPClient when the bind successes and net and transport is nil", want: want{ - want: new(Client), + want: new(HTTPClient), }, }, { - name: "return Client when the bind successes and net and transport is not nil", + name: "return HTTPClient when the bind successes and net and transport is not nil", fields: fields{ Net: new(Net), Transport: new(Transport), }, want: want{ - want: &Client{ + want: &HTTPClient{ Net: new(Net), Transport: &Transport{ RoundTripper: new(RoundTripper), @@ -87,7 +87,7 @@ func TestClient_Bind(t *testing.T) { if test.checkFunc == nil { checkFunc = defaultCheckFunc } - c := &Client{ + c := &HTTPClient{ Net: test.fields.Net, Transport: test.fields.Transport, } diff --git a/internal/config/meta.go b/internal/config/meta.go deleted file mode 100644 index d458f1b9dc..0000000000 --- a/internal/config/meta.go +++ /dev/null @@ -1,49 +0,0 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Package config providers configuration type and load configuration logic -package config - -import ( - "github.com/vdaas/vald/internal/net" -) - -// Meta represents the configurations for vald meta. -type Meta struct { - Host string `json:"host" yaml:"host"` - Port uint16 `json:"port" yaml:"port"` - Client *GRPCClient `json:"client" yaml:"client"` - EnableCache bool `json:"enable_cache" yaml:"enable_cache"` - CacheExpiration string `json:"cache_expiration" yaml:"cache_expiration"` - ExpiredCacheCheckDuration string `json:"expired_cache_check_duration" yaml:"expired_cache_check_duration"` -} - -// Bind binds the actual data from Meta receiver fields. -func (m *Meta) Bind() *Meta { - m.Host = GetActualValue(m.Host) - m.CacheExpiration = GetActualValue(m.CacheExpiration) - m.ExpiredCacheCheckDuration = GetActualValue(m.ExpiredCacheCheckDuration) - - if m.Client != nil { - m.Client.Bind() - } else { - m.Client = newGRPCClientConfig() - } - if len(m.Host) != 0 { - m.Client.Addrs = append(m.Client.Addrs, net.JoinHostPort(m.Host, m.Port)) - } - return m -} diff --git a/internal/config/meta_test.go b/internal/config/meta_test.go deleted file mode 100644 index 5c94ef85cd..0000000000 --- a/internal/config/meta_test.go +++ /dev/null @@ -1,222 +0,0 @@ -// -// Copyright (C) 2019-2022 vdaas.org vald team -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Package config providers configuration type and load configuration logic -package config - -import ( - "reflect" - "strconv" - "testing" - - "github.com/vdaas/vald/internal/errors" - "github.com/vdaas/vald/internal/test/goleak" -) - -func TestMeta_Bind(t *testing.T) { - type fields struct { - Host string - Port uint16 - Client *GRPCClient - EnableCache bool - CacheExpiration string - ExpiredCacheCheckDuration string - } - type want struct { - want *Meta - } - type test struct { - name string - fields fields - want want - checkFunc func(want, *Meta) error - beforeFunc func(*testing.T) - afterFunc func(*testing.T) - } - defaultCheckFunc := func(w want, got *Meta) error { - if !reflect.DeepEqual(got, w.want) { - return errors.Errorf("got: \"%#v\",\n\t\t\t\twant: \"%#v\"", got, w.want) - } - return nil - } - tests := []test{ - func() test { - host := "vald-meta.vald.svc.cluster.local" - port := uint16(8081) - enableCache := true - cacheExpiration := "24h" - expiredCacheCheckDuration := "1m" - return test{ - name: "return Meta when all parameters are not nil or empty", - fields: fields{ - Host: host, - Port: port, - Client: &GRPCClient{ - DialOption: &DialOption{ - Insecure: true, - }, - }, - EnableCache: enableCache, - CacheExpiration: cacheExpiration, - ExpiredCacheCheckDuration: expiredCacheCheckDuration, - }, - want: want{ - want: &Meta{ - Host: host, - Port: port, - Client: &GRPCClient{ - Addrs: []string{ - host + ":" + strconv.FormatUint(uint64(port), 10), - }, - ConnectionPool: &ConnectionPool{}, - DialOption: &DialOption{ - Insecure: true, - }, - TLS: &TLS{ - Enabled: false, - }, - }, - EnableCache: enableCache, - CacheExpiration: cacheExpiration, - ExpiredCacheCheckDuration: expiredCacheCheckDuration, - }, - }, - } - }(), - func() test { - host := "vald-meta.vald.svc.cluster.local" - port := uint16(8081) - enableCache := true - cacheExpiration := "24h" - expiredCacheCheckDuration := "1m" - return test{ - name: "return Meta when Client is nil and others are not empty", - fields: fields{ - Host: host, - Port: port, - EnableCache: enableCache, - CacheExpiration: cacheExpiration, - ExpiredCacheCheckDuration: expiredCacheCheckDuration, - }, - want: want{ - want: &Meta{ - Host: host, - Port: port, - Client: &GRPCClient{ - Addrs: []string{ - host + ":" + strconv.FormatUint(uint64(port), 10), - }, - DialOption: &DialOption{ - Insecure: true, - }, - }, - EnableCache: enableCache, - CacheExpiration: cacheExpiration, - ExpiredCacheCheckDuration: expiredCacheCheckDuration, - }, - }, - } - }(), - func() test { - envPrefix := "META_BIND_" - p := map[string]string{ - envPrefix + "HOST": "vald-meta.vald.svc.cluster.local", - envPrefix + "CACHE_EXPIRATION": "24h", - envPrefix + "EXPIRED_CACHE_CHECK_DURATION": "1m", - } - port := uint16(8081) - enableCache := true - return test{ - name: "return Meta when some parameters are set as environment value", - fields: fields{ - Host: "_" + envPrefix + "HOST_", - Port: port, - EnableCache: enableCache, - CacheExpiration: "_" + envPrefix + "CACHE_EXPIRATION_", - ExpiredCacheCheckDuration: "_" + envPrefix + "EXPIRED_CACHE_CHECK_DURATION_", - }, - beforeFunc: func(t *testing.T) { - t.Helper() - for k, v := range p { - t.Setenv(k, v) - } - }, - want: want{ - want: &Meta{ - Host: "vald-meta.vald.svc.cluster.local", - Port: port, - Client: &GRPCClient{ - Addrs: []string{ - "vald-meta.vald.svc.cluster.local" + ":" + strconv.FormatUint(uint64(port), 10), - }, - DialOption: &DialOption{ - Insecure: true, - }, - }, - EnableCache: enableCache, - CacheExpiration: "24h", - ExpiredCacheCheckDuration: "1m", - }, - }, - } - }(), - func() test { - return test{ - name: "return Meta when all parameters are nil or empty", - fields: fields{}, - want: want{ - want: &Meta{ - Client: &GRPCClient{ - DialOption: &DialOption{ - Insecure: true, - }, - }, - }, - }, - } - }(), - } - - for _, tc := range tests { - test := tc - t.Run(test.name, func(tt *testing.T) { - defer goleak.VerifyNone(tt, goleak.IgnoreCurrent()) - if test.beforeFunc != nil { - test.beforeFunc(tt) - } - if test.afterFunc != nil { - defer test.afterFunc(tt) - } - checkFunc := test.checkFunc - if test.checkFunc == nil { - checkFunc = defaultCheckFunc - } - m := &Meta{ - Host: test.fields.Host, - Port: test.fields.Port, - Client: test.fields.Client, - EnableCache: test.fields.EnableCache, - CacheExpiration: test.fields.CacheExpiration, - ExpiredCacheCheckDuration: test.fields.ExpiredCacheCheckDuration, - } - - got := m.Bind() - if err := checkFunc(test.want, got); err != nil { - tt.Errorf("error = %v", err) - } - }) - } -} diff --git a/internal/config/sidecar.go b/internal/config/sidecar.go index dd5af4ec58..9144ce528f 100644 --- a/internal/config/sidecar.go +++ b/internal/config/sidecar.go @@ -56,7 +56,7 @@ type AgentSidecar struct { RestoreBackoff *Backoff `yaml:"restore_backoff" json:"restore_backoff"` // Client represent HTTP client configurations - Client *Client `yaml:"client" json:"client"` + Client *HTTPClient `yaml:"client" json:"client"` } // Bind binds the actual data from the AgentSidecar receiver fields. @@ -89,7 +89,7 @@ func (s *AgentSidecar) Bind() *AgentSidecar { if s.Client != nil { s.Client = s.Client.Bind() } else { - s.Client = new(Client) + s.Client = new(HTTPClient).Bind() } return s diff --git a/pkg/agent/core/ngt/config/config.go b/pkg/agent/core/ngt/config/config.go index 81fb4f963b..198c3ff154 100644 --- a/pkg/agent/core/ngt/config/config.go +++ b/pkg/agent/core/ngt/config/config.go @@ -76,90 +76,3 @@ func NewConfig(path string) (cfg *Data, err error) { return cfg, nil } - -// func FakeData() { -// d := Data{ -// Version: "v0.0.1", -// Server: &config.Servers{ -// Servers: []*config.Server{ -// { -// Name: "agent-rest", -// Host: "127.0.0.1", -// Port: 8080, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// { -// Name: "agent-grpc", -// Host: "127.0.0.1", -// Port: 8082, -// Mode: "GRPC", -// }, -// }, -// MetricsServers: []*config.Server{ -// { -// Name: "pprof", -// Host: "127.0.0.1", -// Port: 6060, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// }, -// HealthCheckServers: []*config.Server{ -// { -// Name: "livenesss", -// Host: "127.0.0.1", -// Port: 3000, -// }, -// { -// Name: "readiness", -// Host: "127.0.0.1", -// Port: 3001, -// }, -// }, -// StartUpStrategy: []string{ -// "livenesss", -// "pprof", -// "agent-grpc", -// "agent-rest", -// "readiness", -// }, -// ShutdownStrategy: []string{ -// "readiness", -// "agent-rest", -// "agent-grpc", -// "pprof", -// "livenesss", -// }, -// FullShutdownDuration: "30s", -// TLS: &config.TLS{ -// Enabled: false, -// Cert: "/path/to/cert", -// Key: "/path/to/key", -// CA: "/path/to/ca", -// }, -// }, -// NGT: &config.NGT{ -// IndexPath: "/path/to/index", -// Dimension: 4096, -// BulkInsertChunkSize: 10, -// DistanceType: "l2", -// ObjectType: "float", -// CreationEdgeSize: 20, -// SearchEdgeSize: 10, -// }, -// } -// fmt.Println(config.ToRawYaml(d)) -// } diff --git a/pkg/agent/sidecar/config/config.go b/pkg/agent/sidecar/config/config.go index 3cb6580732..15a8e1cc31 100644 --- a/pkg/agent/sidecar/config/config.go +++ b/pkg/agent/sidecar/config/config.go @@ -102,86 +102,3 @@ func NewConfig(path string) (cfg *Data, err error) { return cfg, nil } - -// func FakeData() { -// d := Data{ -// Version: "v0.0.1", -// Server: &config.Servers{ -// Servers: []*config.Server{ -// { -// Name: "agent-rest", -// Host: "127.0.0.1", -// Port: 8080, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// { -// Name: "agent-grpc", -// Host: "127.0.0.1", -// Port: 8082, -// Mode: "GRPC", -// }, -// }, -// MetricsServers: []*config.Server{ -// { -// Name: "pprof", -// Host: "127.0.0.1", -// Port: 6060, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// }, -// HealthCheckServers: []*config.Server{ -// { -// Name: "livenesss", -// Host: "127.0.0.1", -// Port: 3000, -// }, -// { -// Name: "readiness", -// Host: "127.0.0.1", -// Port: 3001, -// }, -// }, -// StartUpStrategy: []string{ -// "livenesss", -// "pprof", -// "agent-grpc", -// "agent-rest", -// "readiness", -// }, -// ShutdownStrategy: []string{ -// "readiness", -// "agent-rest", -// "agent-grpc", -// "pprof", -// "livenesss", -// }, -// FullShutdownDuration: "30s", -// TLS: &config.TLS{ -// Enabled: false, -// Cert: "/path/to/cert", -// Key: "/path/to/key", -// CA: "/path/to/ca", -// }, -// }, -// Gateway: &config.Gateway{ -// AgentPort: 8080, -// AgentName: "vald-agent", -// BackoffEnabled: false,, -// }, -// } -// fmt.Println(config.ToRawYaml(d)) -// } diff --git a/pkg/agent/sidecar/usecase/sidecar/sidecar.go b/pkg/agent/sidecar/usecase/sidecar/sidecar.go index 6eb9a614a7..6730e3788d 100644 --- a/pkg/agent/sidecar/usecase/sidecar/sidecar.go +++ b/pkg/agent/sidecar/usecase/sidecar/sidecar.go @@ -74,7 +74,7 @@ func New(cfg *config.Data) (r runner.Runner, err error) { } client, err := client.New( - client.WithDialContext(dialer.DialContext), + client.WithDialContext(dialer.GetDialer()), client.WithTLSHandshakeTimeout(cfg.AgentSidecar.Client.Transport.RoundTripper.TLSHandshakeTimeout), client.WithMaxIdleConns(cfg.AgentSidecar.Client.Transport.RoundTripper.MaxIdleConns), client.WithMaxIdleConnsPerHost(cfg.AgentSidecar.Client.Transport.RoundTripper.MaxIdleConnsPerHost), diff --git a/pkg/gateway/filter/config/config.go b/pkg/gateway/filter/config/config.go index 35e470ae64..fbbb159263 100644 --- a/pkg/gateway/filter/config/config.go +++ b/pkg/gateway/filter/config/config.go @@ -95,86 +95,3 @@ func NewConfig(path string) (cfg *Data, err error) { return cfg, nil } - -// func FakeData() { -// d := Data{ -// Version: "v0.0.1", -// Server: &config.Servers{ -// Servers: []*config.Server{ -// { -// Name: "agent-rest", -// Host: "127.0.0.1", -// Port: 8080, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// { -// Name: "agent-grpc", -// Host: "127.0.0.1", -// Port: 8082, -// Mode: "GRPC", -// }, -// }, -// MetricsServers: []*config.Server{ -// { -// Name: "pprof", -// Host: "127.0.0.1", -// Port: 6060, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// }, -// HealthCheckServers: []*config.Server{ -// { -// Name: "livenesss", -// Host: "127.0.0.1", -// Port: 3000, -// }, -// { -// Name: "readiness", -// Host: "127.0.0.1", -// Port: 3001, -// }, -// }, -// StartUpStrategy: []string{ -// "livenesss", -// "pprof", -// "agent-grpc", -// "agent-rest", -// "readiness", -// }, -// ShutdownStrategy: []string{ -// "readiness", -// "agent-rest", -// "agent-grpc", -// "pprof", -// "livenesss", -// }, -// FullShutdownDuration: "30s", -// TLS: &config.TLS{ -// Enabled: false, -// Cert: "/path/to/cert", -// Key: "/path/to/key", -// CA: "/path/to/ca", -// }, -// }, -// Gateway: &config.Gateway{ -// AgentPort: 8080, -// AgentName: "vald-agent", -// BackoffEnabled: false,, -// }, -// } -// fmt.Println(config.ToRawYaml(d)) -// } diff --git a/pkg/gateway/lb/config/config.go b/pkg/gateway/lb/config/config.go index e5fff6aafa..f019d69fd1 100644 --- a/pkg/gateway/lb/config/config.go +++ b/pkg/gateway/lb/config/config.go @@ -77,86 +77,3 @@ func NewConfig(path string) (cfg *Data, err error) { return cfg, nil } - -// func FakeData() { -// d := Data{ -// Version: "v0.0.1", -// Server: &config.Servers{ -// Servers: []*config.Server{ -// { -// Name: "agent-rest", -// Host: "127.0.0.1", -// Port: 8080, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// { -// Name: "agent-grpc", -// Host: "127.0.0.1", -// Port: 8082, -// Mode: "GRPC", -// }, -// }, -// MetricsServers: []*config.Server{ -// { -// Name: "pprof", -// Host: "127.0.0.1", -// Port: 6060, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// }, -// HealthCheckServers: []*config.Server{ -// { -// Name: "livenesss", -// Host: "127.0.0.1", -// Port: 3000, -// }, -// { -// Name: "readiness", -// Host: "127.0.0.1", -// Port: 3001, -// }, -// }, -// StartUpStrategy: []string{ -// "livenesss", -// "pprof", -// "agent-grpc", -// "agent-rest", -// "readiness", -// }, -// ShutdownStrategy: []string{ -// "readiness", -// "agent-rest", -// "agent-grpc", -// "pprof", -// "livenesss", -// }, -// FullShutdownDuration: "30s", -// TLS: &config.TLS{ -// Enabled: false, -// Cert: "/path/to/cert", -// Key: "/path/to/key", -// CA: "/path/to/ca", -// }, -// }, -// Gateway: &config.Gateway{ -// AgentPort: 8080, -// AgentName: "vald-agent", -// BackoffEnabled: false,, -// }, -// } -// fmt.Println(config.ToRawYaml(d)) -// } diff --git a/pkg/manager/index/config/config.go b/pkg/manager/index/config/config.go index 674ce1b7b2..14e5d4712a 100644 --- a/pkg/manager/index/config/config.go +++ b/pkg/manager/index/config/config.go @@ -73,86 +73,3 @@ func NewConfig(path string) (cfg *Data, err error) { } return cfg, nil } - -// func FakeData() { -// d := Data{ -// Version: "v0.0.1", -// Server: &config.Servers{ -// Servers: []*config.Server{ -// { -// Name: "agent-rest", -// Host: "127.0.0.1", -// Port: 8080, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// { -// Name: "agent-grpc", -// Host: "127.0.0.1", -// Port: 8082, -// Mode: "GRPC", -// }, -// }, -// MetricsServers: []*config.Server{ -// { -// Name: "pprof", -// Host: "127.0.0.1", -// Port: 6060, -// Mode: "REST", -// ProbeWaitTime: "3s", -// ShutdownDuration: "5s", -// HandlerTimeout: "5s", -// IdleTimeout: "2s", -// ReadHeaderTimeout: "1s", -// ReadTimeout: "1s", -// WriteTimeout: "1s", -// }, -// }, -// HealthCheckServers: []*config.Server{ -// { -// Name: "livenesss", -// Host: "127.0.0.1", -// Port: 3000, -// }, -// { -// Name: "readiness", -// Host: "127.0.0.1", -// Port: 3001, -// }, -// }, -// StartUpStrategy: []string{ -// "livenesss", -// "pprof", -// "agent-grpc", -// "agent-rest", -// "readiness", -// }, -// ShutdownStrategy: []string{ -// "readiness", -// "agent-rest", -// "agent-grpc", -// "pprof", -// "livenesss", -// }, -// FullShutdownDuration: "30s", -// TLS: &config.TLS{ -// Enabled: false, -// Cert: "/path/to/cert", -// Key: "/path/to/key", -// CA: "/path/to/ca", -// }, -// }, -// Gateway: &config.Gateway{ -// AgentPort: 8080, -// AgentName: "vald-agent", -// BackoffEnabled: false,, -// }, -// } -// fmt.Println(config.ToRawYaml(d)) -// }