MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / listComponents

Function listComponents

controller/Controller.h:190–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190int listComponents(std::unique_ptr<minifi::io::Socket> socket, std::ostream &out, bool show_header = true) {
191 socket->initialize();
192 minifi::io::BufferStream stream;
193 uint8_t op = minifi::c2::Operation::DESCRIBE;
194 stream.write(&op, 1);
195 stream.write("components");
196 if (socket->write(const_cast<uint8_t*>(stream.getBuffer()), gsl::narrow<int>(stream.size())) < 0) {
197 return -1;
198 }
199 uint16_t responses = 0;
200 socket->read(&op, 1);
201 socket->read(responses);
202 if (show_header)
203 out << "Components:" << std::endl;
204
205 for (int i = 0; i < responses; i++) {
206 std::string name, status;
207 socket->read(name, false);
208 socket->read(status, false);
209 out << name << ", running: " << status << std::endl;
210 }
211 return 0;
212}
213
214int listConnections(std::unique_ptr<minifi::io::Socket> socket, std::ostream &out, bool show_header = true) {
215 socket->initialize();

Callers 2

mainFunction · 0.85

Calls 5

initializeMethod · 0.45
writeMethod · 0.45
getBufferMethod · 0.45
sizeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected