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

Function getFrameworks

src/tests/master/update_framework_tests.cpp:123–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121
122
123static Future<v1::master::Response::GetFrameworks> getFrameworks(
124 const process::PID<Master>& pid)
125{
126 v1::master::Call call;
127 call.set_type(v1::master::Call::GET_FRAMEWORKS);
128
129 process::http::Headers headers = createBasicAuthHeaders(DEFAULT_CREDENTIAL);
130 headers["Accept"] = stringify(ContentType::PROTOBUF);
131
132 return process::http::post(
133 pid,
134 "api/v1",
135 headers,
136 serialize(ContentType::PROTOBUF, call),
137 stringify(ContentType::PROTOBUF))
138 .then([](const process::http::Response& httpResponse)
139 -> Future<v1::master::Response::GetFrameworks> {
140 if (httpResponse.status != process::http::OK().status) {
141 return Failure(
142 "GET_FRAMEWORKS failed with response status " +
143 httpResponse.status);
144 }
145
146 Try<v1::master::Response> response =
147 deserialize<mesos::v1::master::Response>(
148 ContentType::PROTOBUF, httpResponse.body);
149
150 if (response.isError()) {
151 return Failure(response.error());
152 }
153
154 if (!response->has_get_frameworks()) {
155 return Failure("Response to GET_FRAMEWORKS has no 'get_frameworks'");
156 }
157
158 return response->get_frameworks();
159 });
160}
161
162
163namespace scheduler {

Callers 3

TEST_FFunction · 0.85
_apiMethod · 0.85
apiMethod · 0.85

Calls 9

createBasicAuthHeadersFunction · 0.85
OKClass · 0.85
FailureClass · 0.85
errorMethod · 0.65
stringifyFunction · 0.50
postFunction · 0.50
serializeFunction · 0.50
thenMethod · 0.45
isErrorMethod · 0.45

Tested by

no test coverage detected