2017-05-18 17:36:26 +03:00
/* -------------------------------------------------------------------------- */
2023-01-09 14:23:19 +03:00
/* Copyright 2002-2023, OpenNebula Project, OpenNebula Systems */
2017-05-18 17:36:26 +03:00
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
2019-09-09 15:43:51 +03:00
# ifndef EXECUTE_HOOK_H_
# define EXECUTE_HOOK_H_
# define EXECUTE_HOOK_MAX_ARG 50
2017-05-18 17:36:26 +03:00
# include <string>
2019-09-09 15:43:51 +03:00
class ExecuteHook
2017-05-18 17:36:26 +03:00
{
public :
2019-09-09 15:43:51 +03:00
ExecuteHook ( const std : : string & _name , const std : : string & _cmd ,
const std : : string & _arg , const std : : string & rl ) ;
2017-05-18 17:36:26 +03:00
2020-09-10 14:32:52 +03:00
~ ExecuteHook ( ) = default ;
2017-05-18 17:36:26 +03:00
2019-09-09 15:43:51 +03:00
void execute ( ) ;
2017-05-18 17:36:26 +03:00
2019-09-09 15:43:51 +03:00
private :
/**
* Name of the Hook
*/
std : : string name ;
2017-05-18 17:36:26 +03:00
2019-09-09 15:43:51 +03:00
/**
* The command to be executed
*/
std : : string cmd ;
/**
* The arguments for the command
*/
const char * c_args [ EXECUTE_HOOK_MAX_ARG ] ;
2017-05-18 17:36:26 +03:00
2019-09-09 15:43:51 +03:00
std : : string args [ EXECUTE_HOOK_MAX_ARG ] ;
2017-05-18 17:36:26 +03:00
} ;
# endif