2019-09-09 15:43:51 +03:00
/* -------------------------------------------------------------------------- */
2023-01-09 14:23:19 +03:00
/* Copyright 2002-2023, OpenNebula Project, OpenNebula Systems */
2019-09-09 15:43:51 +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. */
/* -------------------------------------------------------------------------- */
# ifndef REQUEST_MANAGER_HOOK_H
# define REQUEST_MANAGER_HOOK_H
# include "Request.h"
# include "Nebula.h"
2019-12-10 13:45:15 +03:00
# include "HookPool.h"
2019-09-09 15:43:51 +03:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerHook : public Request
{
protected :
2020-07-02 23:42:10 +03:00
RequestManagerHook ( const std : : string & method_name ,
const std : : string & help ,
const std : : string & params )
2019-09-09 15:43:51 +03:00
: Request ( method_name , params , help )
{
Nebula & nd = Nebula : : instance ( ) ;
2019-09-19 16:26:20 +03:00
pool = nd . get_hkpool ( ) ;
2019-09-09 15:43:51 +03:00
auth_object = PoolObjectSQL : : HOOK ;
} ;
2019-12-10 13:45:15 +03:00
~ RequestManagerHook ( ) = default ;
2019-09-09 15:43:51 +03:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class HookRetry : public RequestManagerHook
{
public :
HookRetry ( ) : RequestManagerHook (
" one.hook.retry " , " Retry a hook execution " , " A:sii " )
{
auth_op = AuthRequest : : MANAGE ;
} ;
2019-12-10 13:45:15 +03:00
~ HookRetry ( ) = default ;
2019-09-09 15:43:51 +03:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
2023-02-07 10:50:30 +03:00
RequestAttributes & att ) override ;
2019-09-09 15:43:51 +03:00
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif