2011-06-03 21:01:52 +04:00
/* -------------------------------------------------------------------------- */
2017-05-25 17:07:35 +03:00
/* Copyright 2002-2017, OpenNebula Project, OpenNebula Systems */
2011-06-03 21:01:52 +04: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_HOST_H
# define REQUEST_MANAGER_HOST_H
# include "Request.h"
# include "Nebula.h"
using namespace std ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerHost : public Request
{
protected :
2016-04-12 01:33:09 +03:00
RequestManagerHost ( const string & method_name ,
const string & help ,
const string & params )
2011-06-03 21:01:52 +04:00
: Request ( method_name , params , help )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_hpool ( ) ;
2012-01-03 05:58:23 +04:00
auth_object = PoolObjectSQL : : HOST ;
2011-06-03 21:01:52 +04:00
} ;
~ RequestManagerHost ( ) { } ;
/* -------------------------------------------------------------------- */
2011-07-07 14:45:13 +04:00
virtual void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) = 0 ;
2011-06-03 21:01:52 +04:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2016-04-12 01:33:09 +03:00
class HostStatus : public RequestManagerHost
2011-06-03 21:01:52 +04:00
{
public :
2016-04-12 01:33:09 +03:00
enum Status
{
ENABLED = 0 ,
DISABLED = 1 ,
OFFLINE = 2
} ;
HostStatus ( ) :
2017-05-07 22:52:34 +03:00
RequestManagerHost ( " one.host.status " , " Sets the status of the host " , " A:sii " )
2011-06-03 21:01:52 +04:00
{
2011-12-28 20:51:10 +04:00
auth_op = AuthRequest : : ADMIN ;
2011-06-03 21:01:52 +04:00
} ;
2016-04-12 01:33:09 +03:00
~ HostStatus ( ) { } ;
2011-06-03 21:01:52 +04:00
2011-07-07 14:45:13 +04:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
2011-06-03 21:01:52 +04:00
} ;
2012-05-16 20:00:31 +04:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class HostMonitoring : public RequestManagerHost
{
public :
HostMonitoring ( ) :
2017-05-07 22:52:34 +03:00
RequestManagerHost ( " one.host.monitoring " ,
2012-05-16 20:00:31 +04:00
" Returns the host monitoring records " ,
" A:si " )
{
auth_op = AuthRequest : : USE ;
} ;
~ HostMonitoring ( ) { } ;
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
} ;
2011-06-03 21:01:52 +04:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif