Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
AlbCurlHelper Class Reference

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...
 

Detailed Description

Class to handle the curl ALB requests.

Definition at line 15 of file alb_curl_helper.h.

Member Enumeration Documentation

◆ processing_config_e

Processing configuration services.

Enumerator
Get 
Put 

Definition at line 25 of file alb_curl_helper.h.

◆ processing_service_e

Processing services of the ALB.

Enumerator
Restart 
Stop 
Status 

Definition at line 18 of file alb_curl_helper.h.

◆ storage_service_e

Storage services.

Enumerator
Download 
Upload 
List 

Definition at line 28 of file alb_curl_helper.h.

Constructor & Destructor Documentation

◆ AlbCurlHelper()

AlbCurlHelper::AlbCurlHelper ( const std::string &  ip_address)

Definition at line 51 of file alb_curl_helper.cpp.

◆ ~AlbCurlHelper()

AlbCurlHelper::~AlbCurlHelper ( void  )

Definition at line 59 of file alb_curl_helper.cpp.

Member Function Documentation

◆ defineBaseCommand()

void AlbCurlHelper::defineBaseCommand ( const std::string &  alb_command)
private

Define base curl command for the ALB.

Definition at line 206 of file alb_curl_helper.cpp.

◆ defineProcessingConfig()

bool AlbCurlHelper::defineProcessingConfig ( const processing_config_e service,
outsight_alb_driver::AlbConfig::Request &  request 
)
private

Define the processing configuration command.

Returns
  • True on success.
  • False on error.

Definition at line 220 of file alb_curl_helper.cpp.

◆ defineStorageCommand()

bool AlbCurlHelper::defineStorageCommand ( const storage_service_e  service,
outsight_alb_driver::AlbFile::Request &  request 
)
private

Define the storage command.

Returns
  • True on success.
  • False on error.

Definition at line 246 of file alb_curl_helper.cpp.

◆ defineStorageListCommand()

bool AlbCurlHelper::defineStorageListCommand ( const outsight_alb_driver::AlbFile::Request &  request)
private

Define the command to list storage files.

Definition at line 366 of file alb_curl_helper.cpp.

◆ executeCurlCommand()

bool AlbCurlHelper::executeCurlCommand ( const std::string &  command)
private

Execute the curl command.

Returns
  • True on success.
  • False on error.

Definition at line 295 of file alb_curl_helper.cpp.

◆ executeProcessing()

bool AlbCurlHelper::executeProcessing ( const processing_service_e  service)

Execute the processing command.

Returns
  • True on success.
  • False on error.

Definition at line 75 of file alb_curl_helper.cpp.

◆ executeProcessingConfig()

bool AlbCurlHelper::executeProcessingConfig ( const processing_config_e service,
outsight_alb_driver::AlbConfig::Request &  request 
)

Execute the processing command for the configuration.

Returns
  • True on success.
  • False on error.

Definition at line 117 of file alb_curl_helper.cpp.

◆ executeProcessingZones()

bool AlbCurlHelper::executeProcessingZones ( std::string &  zones)

Execute the processing command for the zones.

Returns
  • True on success.
  • False on error.

Definition at line 145 of file alb_curl_helper.cpp.

◆ executeStorage()

bool AlbCurlHelper::executeStorage ( const storage_service_e  service,
outsight_alb_driver::AlbFile::Request &  request 
)

Execute the storage command.

Returns
  • True on success.
  • False on error.

Definition at line 166 of file alb_curl_helper.cpp.

◆ exportData()

bool AlbCurlHelper::exportData ( const std::string &  data,
const std::string &  output_path,
const std::string &  print_text = std::string("Print data:") 
)
private

Export the data to the output filepath.

Returns
  • True on success.
  • False otherwise.

Definition at line 319 of file alb_curl_helper.cpp.

◆ getErrorMessage()

const std::string AlbCurlHelper::getErrorMessage ( void  ) const

Get the error message.

Definition at line 70 of file alb_curl_helper.cpp.

◆ initCurl()

bool AlbCurlHelper::initCurl ( void  )
private

Initialize the curl command.

Returns
  • True if curl has been initialized.
  • False on error.

Definition at line 196 of file alb_curl_helper.cpp.

◆ isProcessingRunning()

bool AlbCurlHelper::isProcessingRunning ( bool &  running)

Check if processing is running.

Parameters
runningOutput value, true if processing is running.
Returns
  • True on success.
  • False on error.

Definition at line 94 of file alb_curl_helper.cpp.

◆ readData()

const std::string AlbCurlHelper::readData ( const std::string &  filepath)
private

Read data from the input filepath.

Definition at line 339 of file alb_curl_helper.cpp.

Member Data Documentation

◆ callback_data

std::string AlbCurlHelper::callback_data
protected

Definition at line 121 of file alb_curl_helper.h.

◆ chunk

struct curl_slist* AlbCurlHelper::chunk
protected

Definition at line 117 of file alb_curl_helper.h.

◆ curl

CURL* AlbCurlHelper::curl
protected

Definition at line 116 of file alb_curl_helper.h.

◆ curl_address

std::string AlbCurlHelper::curl_address
protected

Definition at line 120 of file alb_curl_helper.h.

◆ error_message

std::string AlbCurlHelper::error_message
protected

Definition at line 122 of file alb_curl_helper.h.

◆ file

FILE* AlbCurlHelper::file
protected

Definition at line 124 of file alb_curl_helper.h.

◆ server_response

long AlbCurlHelper::server_response
protected

Definition at line 118 of file alb_curl_helper.h.


The documentation for this class was generated from the following files:


outsight_alb_driver
Author(s): Outsight
autogenerated on Thu Oct 13 2022 02:21:45