15 #ifndef TENSORFLOW_SERVING_MODEL_SERVERS_HTTP_REST_API_HANDLER_H_
16 #define TENSORFLOW_SERVING_MODEL_SERVERS_HTTP_REST_API_HANDLER_H_
23 #include "absl/strings/string_view.h"
24 #include "absl/types/optional.h"
26 #include "tensorflow/core/lib/core/status.h"
27 #include "tensorflow/core/protobuf/config.pb.h"
28 #include "tensorflow/core/protobuf/meta_graph.pb.h"
29 #include "tensorflow_serving/model_servers/http_rest_api_handler_base.h"
31 namespace tensorflow {
38 class TensorflowPredictor;
69 static const char*
const kPathRegex;
82 Status ProcessRequest(
const absl::string_view http_method,
83 const absl::string_view request_path,
84 const absl::string_view request_body,
85 std::vector<std::pair<string, string>>* headers,
86 string* model_name,
string* method,
87 string* output)
override;
90 Status ProcessClassifyRequest(
91 const absl::string_view model_name,
92 const absl::optional<int64_t>& model_version,
93 const absl::optional<absl::string_view>& model_version_label,
94 const absl::string_view request_body,
string* output);
95 Status ProcessRegressRequest(
96 const absl::string_view model_name,
97 const absl::optional<int64_t>& model_version,
98 const absl::optional<absl::string_view>& model_version_label,
99 const absl::string_view request_body,
string* output);
100 Status ProcessPredictRequest(
101 const absl::string_view model_name,
102 const absl::optional<int64_t>& model_version,
103 const absl::optional<absl::string_view>& model_version_label,
104 const absl::string_view request_body,
string* output);
105 Status ProcessModelStatusRequest(
106 const absl::string_view model_name,
107 const absl::optional<int64_t>& model_version,
108 const absl::optional<absl::string_view>& model_version_label,
110 Status ProcessModelMetadataRequest(
111 const absl::string_view model_name,
112 const absl::optional<int64_t>& model_version,
113 const absl::optional<absl::string_view>& model_version_label,
115 Status GetInfoMap(
const ModelSpec& model_spec,
const string& signature_name,
116 ::google::protobuf::Map<string, tensorflow::TensorInfo>* infomap);
118 RunOptions run_options_;
120 std::unique_ptr<TensorflowPredictor> predictor_;