Class to handle the curl ALB requests. More...
#include <alb_curl_helper.h>
Public Types | |
| enum | processing_config_e { Get = 0, Put } |
| Processing configuration services. More... | |
| enum | processing_service_e { Restart = 0, Stop, Status } |
| Processing services of the ALB. More... | |
| enum | storage_service_e { Download = 0, Upload, List } |
| Storage services. More... | |
Public Member Functions | |
| AlbCurlHelper (const std::string &ip_address) | |
| bool | executeProcessing (const processing_service_e service) |
| Execute the processing command. More... | |
| bool | executeProcessingConfig (const processing_config_e &service, outsight_alb_driver::AlbConfig::Request &request) |
| Execute the processing command for the configuration. More... | |
| bool | executeProcessingZones (std::string &zones) |
| Execute the processing command for the zones. More... | |
| bool | executeStorage (const storage_service_e service, outsight_alb_driver::AlbFile::Request &request) |
| Execute the storage command. More... | |
| const std::string | getErrorMessage (void) const |
| Get the error message. More... | |
| bool | isProcessingRunning (bool &running) |
| Check if processing is running. More... | |
| ~AlbCurlHelper (void) | |
Protected Attributes | |
| std::string | callback_data |
| struct curl_slist * | chunk |
| CURL * | curl |
| std::string | curl_address |
| std::string | error_message |
| FILE * | file |
| long | server_response |
Private Member Functions | |
| void | defineBaseCommand (const std::string &alb_command) |
| Define base curl command for the ALB. More... | |
| bool | defineProcessingConfig (const processing_config_e &service, outsight_alb_driver::AlbConfig::Request &request) |
| Define the processing configuration command. More... | |
| bool | defineStorageCommand (const storage_service_e service, outsight_alb_driver::AlbFile::Request &request) |
| Define the storage command. More... | |
| bool | defineStorageListCommand (const outsight_alb_driver::AlbFile::Request &request) |
| Define the command to list storage files. More... | |
| bool | executeCurlCommand (const std::string &command) |
| Execute the curl command. More... | |
| bool | exportData (const std::string &data, const std::string &output_path, const std::string &print_text=std::string("Print data:")) |
| Export the data to the output filepath. More... | |
| bool | initCurl (void) |
| Initialize the curl command. More... | |
| const std::string | readData (const std::string &filepath) |
| Read data from the input filepath. More... | |
Class to handle the curl ALB requests.
Definition at line 15 of file alb_curl_helper.h.
Processing configuration services.
| Enumerator | |
|---|---|
| Get | |
| Put | |
Definition at line 25 of file alb_curl_helper.h.
Processing services of the ALB.
| Enumerator | |
|---|---|
| Restart | |
| Stop | |
| Status | |
Definition at line 18 of file alb_curl_helper.h.
| AlbCurlHelper::AlbCurlHelper | ( | const std::string & | ip_address | ) |
Definition at line 51 of file alb_curl_helper.cpp.
| AlbCurlHelper::~AlbCurlHelper | ( | void | ) |
Definition at line 59 of file alb_curl_helper.cpp.
|
private |
Define base curl command for the ALB.
Definition at line 206 of file alb_curl_helper.cpp.
|
private |
Define the processing configuration command.
Definition at line 220 of file alb_curl_helper.cpp.
|
private |
Define the storage command.
Definition at line 246 of file alb_curl_helper.cpp.
|
private |
Define the command to list storage files.
Definition at line 366 of file alb_curl_helper.cpp.
|
private |
Execute the curl command.
Definition at line 295 of file alb_curl_helper.cpp.
| bool AlbCurlHelper::executeProcessing | ( | const processing_service_e | service | ) |
Execute the processing command.
Definition at line 75 of file alb_curl_helper.cpp.
| bool AlbCurlHelper::executeProcessingConfig | ( | const processing_config_e & | service, |
| outsight_alb_driver::AlbConfig::Request & | request | ||
| ) |
Execute the processing command for the configuration.
Definition at line 117 of file alb_curl_helper.cpp.
| bool AlbCurlHelper::executeProcessingZones | ( | std::string & | zones | ) |
Execute the processing command for the zones.
Definition at line 145 of file alb_curl_helper.cpp.
| bool AlbCurlHelper::executeStorage | ( | const storage_service_e | service, |
| outsight_alb_driver::AlbFile::Request & | request | ||
| ) |
Execute the storage command.
Definition at line 166 of file alb_curl_helper.cpp.
|
private |
Export the data to the output filepath.
Definition at line 319 of file alb_curl_helper.cpp.
| const std::string AlbCurlHelper::getErrorMessage | ( | void | ) | const |
Get the error message.
Definition at line 70 of file alb_curl_helper.cpp.
|
private |
Initialize the curl command.
Definition at line 196 of file alb_curl_helper.cpp.
| bool AlbCurlHelper::isProcessingRunning | ( | bool & | running | ) |
Check if processing is running.
| running | Output value, true if processing is running. |
Definition at line 94 of file alb_curl_helper.cpp.
|
private |
Read data from the input filepath.
Definition at line 339 of file alb_curl_helper.cpp.
|
protected |
Definition at line 121 of file alb_curl_helper.h.
|
protected |
Definition at line 117 of file alb_curl_helper.h.
|
protected |
Definition at line 116 of file alb_curl_helper.h.
|
protected |
Definition at line 120 of file alb_curl_helper.h.
|
protected |
Definition at line 122 of file alb_curl_helper.h.
|
protected |
Definition at line 124 of file alb_curl_helper.h.
|
protected |
Definition at line 118 of file alb_curl_helper.h.