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