MCPcopy Create free account
hub / github.com/apache/mesos / deserialize

Method deserialize

src/tests/agent_container_api_tests.cpp:134–151  ·  view source on GitHub ↗

Helper function to deserialize the response from the `/api/v1` agent endpoint as a V1 response protobuf.

Source from the content-addressed store, hash-verified

132 // Helper function to deserialize the response from the `/api/v1` agent
133 // endpoint as a V1 response protobuf.
134 Future<v1::agent::Response> deserialize(
135 const Future<http::Response>& response)
136 {
137 ContentType contentType = std::get<2>(GetParam());
138
139 return response
140 .then([contentType](const http::Response& response)
141 -> Future<v1::agent::Response> {
142 if (response.status != http::OK().status) {
143 return Failure(
144 "Unexpected response status: " + response.status +
145 ": " + response.body);
146 }
147
148 return mesos::internal::deserialize<v1::agent::Response>(
149 contentType, response.body);
150 });
151 }
152
153 // Helper function to launch a top level container based on the first
154 // test parameter:

Callers

nothing calls this directly

Calls 3

OKClass · 0.85
FailureClass · 0.85
thenMethod · 0.45

Tested by

no test coverage detected