2011-05-24 17:31:27 +02:00
/* -------------------------------------------------------------------------- */
2024-07-29 14:25:20 +02:00
/* Copyright 2002-2024, OpenNebula Project, OpenNebula Systems */
2011-05-24 17:31:27 +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_POOL_INFO_FILTER_H_
# define REQUEST_MANAGER_POOL_INFO_FILTER_H_
# include "Request.h"
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerPoolInfoFilter : public Request
{
2012-05-05 03:18:25 +02:00
public :
2012-01-05 18:56:37 +01:00
/** Specify all objects the user has right to USE (-2) */
2011-12-01 09:56:29 -08:00
static const int ALL ;
/** Specify user's objects in the pool (-3) */
static const int MINE ;
2012-01-05 18:56:37 +01:00
/** Specify user's + group objects (-1) */
static const int MINE_GROUP ;
2016-09-30 17:31:49 +02:00
/** Specify group objects (-4) */
static const int GROUP ;
2014-09-11 17:00:27 +02:00
/**
* Set a where filter to get the oids of objects that a user can " USE "
* @ param att the XML - RPC Attributes with user information
* @ param auth_object the object type
* @ param where_string will store the resulting SQL filter
* @ return true if the use_filter is empty and access to all objects
* should be granted .
*/
2014-09-23 20:18:18 +02:00
static bool use_filter ( RequestAttributes & att ,
2024-06-03 11:40:24 +02:00
PoolObjectSQL : : ObjectType aobj ,
bool disable_all_acl ,
bool disable_cluster_acl ,
bool disable_group_acl ,
const std : : string & and_str ,
std : : string & where_str ) ;
2014-09-11 17:00:27 +02:00
2012-05-05 03:18:25 +02:00
protected :
2019-03-29 12:43:59 +01:00
/*
* True to gather full info
*/
bool extended ;
2020-07-02 22:42:10 +02:00
RequestManagerPoolInfoFilter ( const std : : string & method_name ,
const std : : string & help ,
const std : : string & signature )
2024-06-03 11:40:24 +02:00
: Request ( method_name , signature , help )
2017-05-08 10:47:42 +02:00
{
leader_only = false ;
2019-03-29 12:43:59 +01:00
extended = false ;
2021-04-20 13:40:44 +02:00
zone_disabled = true ;
2017-05-08 10:47:42 +02:00
} ;
2012-05-05 03:18:25 +02:00
2019-07-05 17:23:21 +02:00
void request_execute (
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-01-05 18:31:19 +01:00
2012-05-05 03:18:25 +02:00
void where_filter ( RequestAttributes & att ,
2024-06-03 11:40:24 +02:00
int filter_flag ,
int start_id ,
int end_id ,
const std : : string & and_clause ,
const std : : string & or_clause ,
bool disable_all_acl ,
bool disable_cluster_acl ,
bool disable_group_acl ,
std : : string & where_string ) ;
2012-05-04 17:27:57 +02:00
void dump ( RequestAttributes & att ,
2012-01-06 01:12:55 +01:00
int filter_flag ,
2012-05-04 17:27:57 +02:00
int start_id ,
2012-01-06 01:12:55 +01:00
int end_id ,
2020-07-02 22:42:10 +02:00
const std : : string & and_clause ,
const std : : string & or_clause ) ;
2011-05-24 17:31:27 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VirtualMachinePoolInfo : public RequestManagerPoolInfoFilter
{
public :
2011-06-27 13:19:03 +02:00
/* -------------------------------------------------------------------- */
2011-06-27 16:20:31 +02:00
static const int ALL_VM ; /**< VMs in any state (-2) */
static const int NOT_DONE ; /**< VMs in any state expect DONE (-1)*/
2011-06-27 13:19:03 +02:00
/* -------------------------------------------------------------------- */
2019-12-10 11:45:15 +01:00
VirtualMachinePoolInfo ( ) ;
2011-05-24 17:31:27 +02:00
2020-07-02 22:42:10 +02:00
VirtualMachinePoolInfo ( const std : : string & method_name ,
const std : : string & help ,
const std : : string & signature ) ;
2012-01-05 18:31:19 +01:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2011-05-24 17:31:27 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2019-03-29 12:43:59 +01:00
class VirtualMachinePoolInfoExtended : public VirtualMachinePoolInfo
{
public :
VirtualMachinePoolInfoExtended ( ) :
VirtualMachinePoolInfo ( " one.vmpool.infoextended " ,
2024-06-03 11:40:24 +02:00
" Returns the virtual machine instances pool in extended format " ,
" A:siiiis " )
2019-03-29 12:43:59 +01:00
{
extended = true ;
} ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2020-10-22 12:55:27 +02:00
class VirtualMachinePoolInfoSet : public RequestManagerPoolInfoFilter
{
public :
VirtualMachinePoolInfoSet ( ) ;
void request_execute (
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2012-05-04 17:27:57 +02:00
class VirtualMachinePoolAccounting : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
VirtualMachinePoolAccounting ( ) ;
2012-05-04 17:27:57 +02:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-05-04 17:27:57 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2014-10-30 17:45:32 +01:00
class VirtualMachinePoolShowback : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
VirtualMachinePoolShowback ( ) ;
2014-10-30 17:45:32 +01:00
2012-05-04 17:27:57 +02:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-05-04 17:27:57 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2012-05-16 16:09:27 +02:00
class VirtualMachinePoolMonitoring : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
VirtualMachinePoolMonitoring ( ) ;
2012-05-16 16:09:27 +02:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-05-16 16:09:27 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2011-05-24 17:31:27 +02:00
class TemplatePoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
TemplatePoolInfo ( ) ;
2011-05-24 17:31:27 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VirtualNetworkPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
VirtualNetworkPoolInfo ( ) ;
2011-05-24 17:31:27 +02:00
2014-09-23 20:18:18 +02:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2011-05-24 17:31:27 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2018-11-20 17:24:59 +01:00
class VirtualNetworkTemplatePoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
VirtualNetworkTemplatePoolInfo ( ) ;
2018-11-20 17:24:59 +01:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2011-05-24 17:31:27 +02:00
class ImagePoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
ImagePoolInfo ( ) ;
2011-05-24 17:31:27 +02:00
} ;
2012-01-05 18:31:19 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class HostPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
HostPoolInfo ( ) ;
2012-01-05 18:31:19 +01:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-01-05 18:31:19 +01:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2012-05-16 18:00:31 +02:00
class HostPoolMonitoring : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
HostPoolMonitoring ( ) ;
2012-05-16 18:00:31 +02:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-05-16 18:00:31 +02:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
2012-01-05 18:31:19 +01:00
class GroupPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
GroupPoolInfo ( ) ;
2012-01-05 18:31:19 +01:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-01-05 18:31:19 +01:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class UserPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
UserPoolInfo ( ) ;
2012-01-05 18:31:19 +01:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-01-05 18:31:19 +01:00
} ;
2012-02-09 17:56:47 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class DatastorePoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
DatastorePoolInfo ( ) ;
2012-02-09 17:56:47 +01:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-02-09 17:56:47 +01:00
} ;
2012-02-24 15:53:53 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class ClusterPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
ClusterPoolInfo ( ) ;
2012-02-24 15:53:53 +01:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-02-24 15:53:53 +01:00
} ;
2012-06-08 16:00:16 +02:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class DocumentPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
DocumentPoolInfo ( ) ;
2012-06-08 16:00:16 +02:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2012-06-08 16:00:16 +02:00
} ;
2013-12-12 19:08:59 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class ZonePoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
ZonePoolInfo ( ) ;
2013-12-12 19:08:59 +01:00
void request_execute (
2019-07-05 17:23:21 +02:00
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
2013-12-12 19:08:59 +01:00
} ;
2014-09-08 11:50:25 +02:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class SecurityGroupPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
SecurityGroupPoolInfo ( ) ;
2014-09-08 11:50:25 +02:00
} ;
2014-12-19 17:30:00 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VdcPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
VdcPoolInfo ( ) ;
2014-12-19 17:30:00 +01:00
2019-07-05 17:23:21 +02:00
void request_execute ( xmlrpc_c : : paramList const & pl , RequestAttributes & att ) override ;
2014-12-19 17:30:00 +01:00
} ;
2015-11-30 16:50:23 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VirtualRouterPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
VirtualRouterPoolInfo ( ) ;
2015-11-30 16:50:23 +01:00
} ;
2011-05-24 17:31:27 +02:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
2015-12-05 23:52:28 +01:00
class MarketPlacePoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
MarketPlacePoolInfo ( ) ;
2015-12-05 23:52:28 +01:00
2019-07-05 17:23:21 +02:00
void request_execute ( xmlrpc_c : : paramList const & pl , RequestAttributes & att ) override ;
2015-12-05 23:52:28 +01:00
} ;
2011-05-24 17:31:27 +02:00
2015-12-11 15:53:19 +01:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
class MarketPlaceAppPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
MarketPlaceAppPoolInfo ( ) ;
2015-12-11 15:53:19 +01:00
} ;
2017-01-03 01:22:10 +01:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VMGroupPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
VMGroupPoolInfo ( ) ;
2017-01-03 01:22:10 +01:00
} ;
2019-09-09 14:43:51 +02:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class HookPoolInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
HookPoolInfo ( ) ;
2019-09-09 14:43:51 +02:00
} ;
2019-09-19 15:26:20 +02:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class HookLogInfo : public RequestManagerPoolInfoFilter
{
public :
2019-12-10 11:45:15 +01:00
HookLogInfo ( ) ;
2019-09-19 15:26:20 +02:00
void request_execute (
xmlrpc_c : : paramList const & paramList , RequestAttributes & att ) override ;
} ;
2023-07-03 18:15:52 +02:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class BackupJobPoolInfo : public RequestManagerPoolInfoFilter
{
public :
BackupJobPoolInfo ( ) ;
} ;
2011-05-24 17:31:27 +02:00
# endif