2017-04-11 22:34:38 +03:00
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2016, OpenNebula Project, OpenNebula Systems */
/* */
/* 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_ZONE_H
# define REQUEST_MANAGER_ZONE_H
# include "Request.h"
# include "Nebula.h"
using namespace std ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerZone : public Request
{
protected :
RequestManagerZone ( const string & method_name ,
const string & help ,
const string & params )
: Request ( method_name , params , help )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_zonepool ( ) ;
auth_object = PoolObjectSQL : : ZONE ;
auth_op = AuthRequest : : ADMIN ;
} ;
~ RequestManagerZone ( ) { } ;
/* -------------------------------------------------------------------- */
virtual void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) = 0 ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class ZoneAddServer : public RequestManagerZone
{
public :
ZoneAddServer ( ) :
RequestManagerZone ( " ZoneAddServer " , " Add a server to zone " , " A:sis " ) { } ;
~ ZoneAddServer ( ) { } ;
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
} ;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
2017-04-13 19:31:14 +03:00
class ZoneDeleteServer : public RequestManagerZone
{
public :
ZoneDeleteServer ( ) :
RequestManagerZone ( " ZoneDeleteServer " , " Delete a server from zone " ,
" A:sii " ) { } ;
~ ZoneDeleteServer ( ) { } ;
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
} ;
2017-04-27 13:42:09 +03:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class ZoneReplicateLog : public RequestManagerZone
{
public :
ZoneReplicateLog ( ) :
RequestManagerZone ( " ZoneReplicateLog " , " Replicate a log record " ,
2017-05-03 21:04:42 +03:00
" A:siiiiiiis " ) { } ;
2017-04-27 13:42:09 +03:00
~ ZoneReplicateLog ( ) { } ;
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
} ;
2017-05-03 00:43:18 +03:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class ZoneVoteRequest : public RequestManagerZone
{
public :
ZoneVoteRequest ( ) :
RequestManagerZone ( " ZoneVoteRequest " , " Request vote from a candidate " ,
" A:siiii " ) { } ;
~ ZoneVoteRequest ( ) { } ;
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
} ;
2017-05-06 01:17:27 +03:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class ZoneRaftStatus : public RequestManagerZone
{
public :
ZoneRaftStatus ( ) :
RequestManagerZone ( " ZoneRaftInformation " , " Returns Raft status " ,
" A:s " ) { } ;
~ ZoneRaftStatus ( ) { } ;
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
} ;
2017-04-11 22:34:38 +03:00
# endif