2008-06-17 20:27:32 +04:00
/* -------------------------------------------------------------------------- */
2011-02-25 16:34:44 +03:00
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
2008-06-17 20:27:32 +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_H_
# define REQUEST_MANAGER_H_
# include "ActionManager.h"
# include "VirtualMachinePool.h"
# include "HostPool.h"
2009-07-09 18:34:34 +04:00
# include "UserPool.h"
2008-11-13 19:21:17 +03:00
# include "VirtualNetworkPool.h"
2010-05-31 20:40:38 +04:00
# include "ImagePool.h"
2011-03-14 21:06:39 +03:00
# include "ClusterPool.h"
2011-03-30 21:03:49 +04:00
# include "VMTemplatePool.h"
2011-05-10 20:45:15 +04:00
# include "GroupPool.h"
2008-06-17 20:27:32 +04:00
# include <xmlrpc-c/base.hpp>
# include <xmlrpc-c/registry.hpp>
# include <xmlrpc-c/server_abyss.hpp>
using namespace std ;
extern " C " void * rm_action_loop ( void * arg ) ;
extern " C " void * rm_xml_server_loop ( void * arg ) ;
class RequestManager : public ActionListener
{
public :
RequestManager (
VirtualMachinePool * _vmpool ,
HostPool * _hpool ,
2008-11-13 19:21:17 +03:00
VirtualNetworkPool * _vnpool ,
2009-07-09 18:34:34 +04:00
UserPool * _upool ,
2010-05-31 20:40:38 +04:00
ImagePool * _ipool ,
2011-03-14 21:06:39 +03:00
ClusterPool * _cpool ,
2011-03-30 21:03:49 +04:00
VMTemplatePool * _tpool ,
2011-05-10 20:45:15 +04:00
GroupPool * _gpool ,
2008-06-17 20:27:32 +04:00
int _port ,
string _xml_log_file )
2009-07-09 18:34:34 +04:00
: vmpool ( _vmpool ) , hpool ( _hpool ) , vnpool ( _vnpool ) , upool ( _upool ) ,
2011-05-10 20:45:15 +04:00
ipool ( _ipool ) , cpool ( _cpool ) , tpool ( _tpool ) , gpool ( _gpool ) , port ( _port ) ,
socket_fd ( - 1 ) , xml_log_file ( _xml_log_file )
2008-06-17 20:27:32 +04:00
{
am . addListener ( this ) ;
} ;
~ RequestManager ( )
{ }
;
/**
2010-08-05 21:28:28 +04:00
* This functions starts the associated listener thread ( XML server ) , and
2008-06-17 20:27:32 +04:00
* creates a new thread for the Request Manager . This thread will wait in
* an action loop till it receives ACTION_FINALIZE .
* @ return 0 on success .
*/
int start ( ) ;
/**
* Gets the thread identification .
* @ return pthread_t for the manager thread ( that in the action loop ) .
*/
pthread_t get_thread_id ( ) const
{
return rm_thread ;
} ;
/**
2010-08-05 21:28:28 +04:00
*
2008-06-17 20:27:32 +04:00
*/
void finalize ( )
{
am . trigger ( ACTION_FINALIZE , 0 ) ;
} ;
private :
//--------------------------------------------------------------------------
// Friends, thread functions require C-linkage
//--------------------------------------------------------------------------
friend void * rm_xml_server_loop ( void * arg ) ;
friend void * rm_action_loop ( void * arg ) ;
/**
* Thread id for the RequestManager
*/
pthread_t rm_thread ;
/**
* Thread id for the XML Server
*/
pthread_t rm_xml_server_thread ;
/**
2008-11-13 19:21:17 +03:00
* Pointer to the VM Pool , to access Virtual Machines
2008-06-17 20:27:32 +04:00
*/
VirtualMachinePool * vmpool ;
/**
* Pointer to the Host Pool , to access hosts
*/
2009-07-09 18:34:34 +04:00
HostPool * hpool ;
2010-08-05 21:28:28 +04:00
2008-11-13 19:21:17 +03:00
/**
* Pointer to the VN Pool , to access Virtual Netowrks
*/
VirtualNetworkPool * vnpool ;
2010-08-05 21:28:28 +04:00
2009-07-09 18:34:34 +04:00
/**
* Pointer to the User Pool , to access users
*/
UserPool * upool ;
2010-08-05 21:28:28 +04:00
2010-05-31 20:40:38 +04:00
/**
* Pointer to the Image Pool , to access images
*/
ImagePool * ipool ;
2008-06-17 20:27:32 +04:00
2011-03-14 21:06:39 +03:00
/**
2011-03-30 21:03:49 +04:00
* Pointer to the Cluster Pool , to access clusters
2011-03-14 21:06:39 +03:00
*/
ClusterPool * cpool ;
2011-03-30 21:03:49 +04:00
/**
* Pointer to the Template Pool , to access templates
*/
VMTemplatePool * tpool ;
2011-05-10 20:45:15 +04:00
/**
* Pointer to the Group Pool , to access groups
*/
GroupPool * gpool ;
2008-06-17 20:27:32 +04:00
/**
* Port number where the connection will be open
*/
int port ;
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
/*
* FD for the XML server socket
2010-08-05 21:28:28 +04:00
*/
2008-06-17 20:27:32 +04:00
int socket_fd ;
/**
* Filename for the log of the xmlrpc server that listens
*/
string xml_log_file ;
/**
* Action engine for the Manager
*/
ActionManager am ;
/**
* To register XML - RPC methods
*/
xmlrpc_c : : registry RequestManagerRegistry ;
/**
* The XML - RPC server
*/
xmlrpc_c : : serverAbyss * AbyssServer ;
/**
* The action function executed when an action is triggered .
* @ param action the name of the action
* @ param arg arguments for the action function
*/
void do_action ( const string & action , void * arg ) ;
void register_xml_methods ( ) ;
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
int setup_socket ( ) ;
2010-08-05 21:28:28 +04:00
2010-07-12 22:10:48 +04:00
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Error Messages
// ----------------------------------------------------------------------
2010-08-05 21:28:28 +04:00
// ----------------------------------------------------------------------
2010-07-15 14:43:27 +04:00
/**
* Logs authorization errors
* @ param method name of the RM method where the error arose
* @ param action authorization action
* @ param object object that needs to be authorized
* @ param uid user that is authorized
* @ param id id of the object , - 1 for Pool
* @ returns string for logging
*/
2010-08-05 21:28:28 +04:00
static string authorization_error ( const string & method ,
const string & action ,
const string & object ,
2010-07-12 22:10:48 +04:00
int uid ,
int id )
{
ostringstream oss ;
2010-08-05 21:28:28 +04:00
oss < < " [ " < < method < < " ] " < < " User [ " < < uid < < " ] not authorized "
< < " to perform " < < action < < " on " < < object ;
2010-07-13 21:26:43 +04:00
if ( id ! = - 1 )
2010-07-13 15:49:16 +04:00
{
oss < < " [ " < < id < < " ]. " ;
}
else
{
oss < < " Pool " ;
}
2010-08-05 21:28:28 +04:00
2010-07-12 22:10:48 +04:00
return oss . str ( ) ;
}
2010-08-05 21:28:28 +04:00
2010-07-15 14:43:27 +04:00
/**
* Logs authenticate errors
* @ param method name of the RM method where the error arose
* @ returns string for logging
2010-08-05 21:28:28 +04:00
*/
2010-07-12 22:10:48 +04:00
static string authenticate_error ( const string & method )
{
ostringstream oss ;
2010-08-05 21:28:28 +04:00
2010-07-12 22:10:48 +04:00
oss < < " [ " < < method < < " ] " < < " User couldn't be authenticated, " < <
2010-07-13 15:49:16 +04:00
" aborting call. " ;
2010-08-05 21:28:28 +04:00
2010-07-12 22:10:48 +04:00
return oss . str ( ) ;
}
2010-08-05 21:28:28 +04:00
2010-07-15 14:43:27 +04:00
/**
* Logs get object errors
* @ param method name of the RM method where the error arose
* @ param object over which the get failed
* @ param id of the object over which the get failed
* @ returns string for logging
*/
2010-08-05 21:28:28 +04:00
static string get_error ( const string & method ,
const string & object ,
2010-07-12 22:10:48 +04:00
int id )
{
ostringstream oss ;
2010-08-05 21:28:28 +04:00
oss < < " [ " < < method < < " ] " < < " Error getting " < <
2010-07-13 15:49:16 +04:00
object ;
2010-08-05 21:28:28 +04:00
2010-07-13 21:26:43 +04:00
if ( id ! = - 1 )
2010-07-13 15:49:16 +04:00
{
oss < < " [ " < < id < < " ]. " ;
}
else
{
2010-08-05 21:28:28 +04:00
oss < < " Pool. " ;
2010-07-13 15:49:16 +04:00
}
2010-08-05 21:28:28 +04:00
2010-07-13 15:49:16 +04:00
return oss . str ( ) ;
}
2010-08-05 21:28:28 +04:00
2010-07-15 14:43:27 +04:00
/**
* Logs action errors
* @ param method name of the RM method where the error arose
* @ param action that triggered the error
* @ param object over which the action was applied
2010-08-05 21:28:28 +04:00
* @ param id id of the object , - 1 for Pool , - 2 for no - id objects
2010-07-15 14:43:27 +04:00
* ( allocate error , parse error )
* @ param rc returned error code ( NULL to ignore )
* @ returns string for logging
*/
2010-07-13 15:49:16 +04:00
static string action_error ( const string & method ,
2010-08-05 21:28:28 +04:00
const string & action ,
const string & object ,
2010-07-13 15:49:16 +04:00
int id ,
int rc )
{
ostringstream oss ;
2010-08-05 21:28:28 +04:00
2010-07-13 15:49:16 +04:00
oss < < " [ " < < method < < " ] " < < " Error trying to " < < action < < " "
< < object ;
2010-08-05 21:28:28 +04:00
2010-07-14 19:28:33 +04:00
switch ( id )
2010-07-13 21:26:43 +04:00
{
2010-07-14 19:28:33 +04:00
case - 2 :
2010-08-05 21:28:28 +04:00
break ;
2010-07-14 19:28:33 +04:00
case - 1 :
oss < < " Pool. " ;
break ;
default :
oss < < " [ " < < id < < " ]. " ;
break ;
2010-07-13 21:26:43 +04:00
}
2010-08-05 21:28:28 +04:00
if ( rc ! = 0 )
2010-07-13 15:49:16 +04:00
{
2010-08-05 21:28:28 +04:00
oss < < " Returned error code [ " < < rc < < " ]. " ;
2010-07-13 15:49:16 +04:00
}
2010-08-05 21:28:28 +04:00
2010-07-12 22:10:48 +04:00
return oss . str ( ) ;
}
2010-08-05 21:28:28 +04:00
2011-05-17 21:13:59 +04:00
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// Constants
// ----------------------------------------------------------------------
// ----------------------------------------------------------------------
// TODO: enum of Objects is maintained in AuthManager.h, could be moved
// to Nebula.h
enum Object
{
VM ,
HOST ,
NET ,
IMAGE ,
USER ,
CLUSTER ,
TEMPLATE ,
GROUP
} ;
PoolSQL * get_pool ( Object ob )
{
switch ( ob )
{
case VM : return static_cast < PoolSQL * > ( vmpool ) ;
case HOST : return static_cast < PoolSQL * > ( hpool ) ;
case NET : return static_cast < PoolSQL * > ( vnpool ) ;
case IMAGE : return static_cast < PoolSQL * > ( ipool ) ;
case USER : return static_cast < PoolSQL * > ( upool ) ;
case CLUSTER : return static_cast < PoolSQL * > ( cpool ) ;
case TEMPLATE : return static_cast < PoolSQL * > ( tpool ) ;
case GROUP : return static_cast < PoolSQL * > ( gpool ) ;
}
} ;
string get_method_prefix ( Object ob )
{
switch ( ob )
{
case VM : return " VirtualMachine " ;
case HOST : return " Host " ;
case NET : return " VirtualNetwork " ;
case IMAGE : return " Image " ;
case USER : return " User " ;
case CLUSTER : return " Cluster " ;
case TEMPLATE : return " Template " ;
case GROUP : return " Group " ;
}
} ;
string get_object_name ( Object ob )
{
switch ( ob )
{
case VM : return " VM " ;
case HOST : return " HOST " ;
case NET : return " NET " ;
case IMAGE : return " IMAGE " ;
case USER : return " USER " ;
case CLUSTER : return " CLUSTER " ;
case TEMPLATE : return " TEMPLATE " ;
case GROUP : return " GROUP " ;
}
} ;
2009-07-09 18:34:34 +04:00
// ----------------------------------------------------------------------
2008-06-17 20:27:32 +04:00
// ----------------------------------------------------------------------
// XML-RPC Methods
// ----------------------------------------------------------------------
2009-07-09 18:34:34 +04:00
// ----------------------------------------------------------------------
2008-06-17 20:27:32 +04:00
2011-05-17 21:13:59 +04:00
/* ---------------------------------------------------------------------- */
/* Generic Helpers */
/* ---------------------------------------------------------------------- */
class GenericChown : public xmlrpc_c : : method
{
public :
GenericChown ( RequestManager * _rm ,
Object _ob ) :
rm ( _rm ) ,
ob ( _ob )
{
_signature = " A:siii " ;
_help = " Changes the owner and/or group " ;
} ;
~ GenericChown ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
RequestManager * rm ;
Object ob ;
} ;
2009-07-09 18:34:34 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
/* Virtual Machine Interface */
2009-07-09 18:34:34 +04:00
/* ---------------------------------------------------------------------- */
2008-06-17 20:27:32 +04:00
class VirtualMachineAllocate : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
VirtualMachineAllocate (
2010-07-15 14:43:27 +04:00
VirtualMachinePool * _vmpool ,
VirtualNetworkPool * _vnpool ,
ImagePool * _ipool ,
2011-04-01 19:17:26 +04:00
VMTemplatePool * _tpool ,
2010-07-15 14:43:27 +04:00
UserPool * _upool ) :
vmpool ( _vmpool ) ,
vnpool ( _vnpool ) ,
ipool ( _ipool ) ,
2011-04-01 19:17:26 +04:00
tpool ( _tpool ) ,
2010-07-15 14:43:27 +04:00
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
_signature = " A:ss " ;
_help = " Allocates a virtual machine in the pool " ;
} ;
~ VirtualMachineAllocate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retval ) ;
2009-07-09 18:34:34 +04:00
private :
2010-07-15 14:43:27 +04:00
VirtualMachinePool * vmpool ;
VirtualNetworkPool * vnpool ;
ImagePool * ipool ;
2011-04-01 19:17:26 +04:00
VMTemplatePool * tpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2008-06-17 20:27:32 +04:00
} ;
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
class VirtualMachineDeploy : public xmlrpc_c : : method
{
public :
VirtualMachineDeploy (
VirtualMachinePool * _vmpool ,
2010-07-15 14:43:27 +04:00
HostPool * _hpool ,
UserPool * _upool ) :
2008-06-17 20:27:32 +04:00
vmpool ( _vmpool ) ,
2009-07-09 18:34:34 +04:00
hpool ( _hpool ) ,
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
_signature = " A:sii " ;
_help = " Deploys a virtual machine " ;
} ;
~ VirtualMachineDeploy ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retval ) ;
private :
VirtualMachinePool * vmpool ;
2009-07-09 18:34:34 +04:00
HostPool * hpool ;
UserPool * upool ;
2008-06-17 20:27:32 +04:00
} ;
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
/* ---------------------------------------------------------------------- */
class VirtualMachineAction : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
VirtualMachineAction (
VirtualMachinePool * _vmpool ,
UserPool * _upool ) :
vmpool ( _vmpool ) ,
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
_signature = " A:ssi " ;
_help = " Performs an action on a virtual machine " ;
} ;
~ VirtualMachineAction ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retval ) ;
private :
VirtualMachinePool * vmpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2008-06-17 20:27:32 +04:00
} ;
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
class VirtualMachineMigrate : public xmlrpc_c : : method
{
public :
VirtualMachineMigrate (
VirtualMachinePool * _vmpool ,
2009-07-09 18:34:34 +04:00
HostPool * _hpool ,
UserPool * _upool ) :
2008-06-17 20:27:32 +04:00
vmpool ( _vmpool ) ,
2009-07-09 18:34:34 +04:00
hpool ( _hpool ) ,
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
_signature = " A:siib " ;
_help = " Migrates a virtual machine " ;
} ;
~ VirtualMachineMigrate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retval ) ;
private :
VirtualMachinePool * vmpool ;
HostPool * hpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2010-08-05 21:28:28 +04:00
} ;
2008-09-08 14:57:52 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
class VirtualMachineInfo : public xmlrpc_c : : method
{
public :
VirtualMachineInfo (
2009-07-09 18:34:34 +04:00
VirtualMachinePool * _vmpool ,
UserPool * _upool ) :
vmpool ( _vmpool ) ,
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
_signature = " A:si " ;
_help = " Returns virtual machine information " ;
} ;
~ VirtualMachineInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retval ) ;
private :
VirtualMachinePool * vmpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2008-06-17 20:27:32 +04:00
} ;
2009-05-22 04:46:52 +04:00
2010-07-21 20:06:40 +04:00
/* ---------------------------------------------------------------------- */
class VirtualMachineSaveDisk : public xmlrpc_c : : method
{
public :
VirtualMachineSaveDisk (
VirtualMachinePool * _vmpool ,
UserPool * _upool ,
ImagePool * _ipool ) :
vmpool ( _vmpool ) ,
upool ( _upool ) ,
ipool ( _ipool )
{
2011-04-07 04:01:40 +04:00
_signature = " A:siis " ;
2011-04-11 18:20:44 +04:00
_help = " Sets the disk to be saved in a new Image with the given "
" name. " ;
2010-07-21 20:06:40 +04:00
} ;
~ VirtualMachineSaveDisk ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retval ) ;
private :
VirtualMachinePool * vmpool ;
UserPool * upool ;
ImagePool * ipool ;
} ;
2009-05-22 04:46:52 +04:00
/* ---------------------------------------------------------------------- */
class VirtualMachinePoolInfo : public xmlrpc_c : : method
{
public :
VirtualMachinePoolInfo (
2009-07-09 18:34:34 +04:00
VirtualMachinePool * _vmpool ,
UserPool * _upool ) :
vmpool ( _vmpool ) ,
upool ( _upool )
2009-05-22 04:46:52 +04:00
{
2011-03-15 19:21:39 +03:00
_signature = " A:sii " ;
2009-05-22 04:46:52 +04:00
_help = " Returns the virtual machine pool " ;
} ;
~ VirtualMachinePoolInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retval ) ;
private :
VirtualMachinePool * vmpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2010-08-05 21:28:28 +04:00
} ;
2011-03-30 21:03:49 +04:00
/* ---------------------------------------------------------------------- */
/* Template Interface */
/* ---------------------------------------------------------------------- */
class TemplateAllocate : public xmlrpc_c : : method
{
public :
TemplateAllocate (
VMTemplatePool * _tpool ,
UserPool * _upool ) :
tpool ( _tpool ) ,
upool ( _upool )
{
_signature = " A:ss " ;
_help = " Allocates a template in the pool " ;
} ;
~ TemplateAllocate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VMTemplatePool * tpool ;
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
class TemplateDelete : public xmlrpc_c : : method
{
public :
TemplateDelete ( VMTemplatePool * _tpool ,
UserPool * _upool ) :
tpool ( _tpool ) ,
upool ( _upool )
{
_signature = " A:si " ;
_help = " Deletes a Template " ;
} ;
~ TemplateDelete ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VMTemplatePool * tpool ;
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
class TemplateInfo : public xmlrpc_c : : method
{
public :
TemplateInfo ( VMTemplatePool * _tpool ,
UserPool * _upool ) :
tpool ( _tpool ) ,
upool ( _upool )
{
_signature = " A:si " ;
_help = " Returns information for a Template " ;
} ;
~ TemplateInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VMTemplatePool * tpool ;
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
class TemplateUpdate : public xmlrpc_c : : method
{
public :
TemplateUpdate ( VMTemplatePool * _tpool ,
UserPool * _upool ) :
tpool ( _tpool ) ,
upool ( _upool )
{
_signature = " A:siss " ;
_help = " Modifies Template attribute " ;
} ;
~ TemplateUpdate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VMTemplatePool * tpool ;
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
class TemplateRemoveAttribute : public xmlrpc_c : : method
{
public :
TemplateRemoveAttribute ( VMTemplatePool * _tpool ,
UserPool * _upool ) :
tpool ( _tpool ) ,
upool ( _upool )
{
_signature = " A:sis " ;
_help = " Removes Template attribute " ;
} ;
~ TemplateRemoveAttribute ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VMTemplatePool * tpool ;
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
class TemplatePublish : public xmlrpc_c : : method
{
public :
TemplatePublish ( VMTemplatePool * _tpool ,
UserPool * _upool ) :
tpool ( _tpool ) ,
upool ( _upool )
{
_signature = " A:sib " ;
_help = " Publish/Unpublish the Template " ;
} ;
~ TemplatePublish ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VMTemplatePool * tpool ;
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
class TemplatePoolInfo : public xmlrpc_c : : method
{
public :
TemplatePoolInfo (
VMTemplatePool * _tpool ,
UserPool * _upool ) :
tpool ( _tpool ) ,
upool ( _upool )
{
_signature = " A:sii " ;
_help = " Returns the template pool " ;
} ;
~ TemplatePoolInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VMTemplatePool * tpool ;
UserPool * upool ;
} ;
2008-06-17 20:27:32 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
/* Host Interface */
2009-07-09 18:34:34 +04:00
/* ---------------------------------------------------------------------- */
2008-06-17 20:27:32 +04:00
class HostAllocate : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
HostAllocate (
HostPool * _hpool ,
UserPool * _upool ) :
hpool ( _hpool ) ,
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
2009-07-09 18:34:34 +04:00
_signature = " A:sssss " ;
2008-06-17 20:27:32 +04:00
_help = " Allocates a host in the pool " ;
} ;
~ HostAllocate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
HostPool * hpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2008-06-17 20:27:32 +04:00
} ;
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
class HostInfo : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
HostInfo (
HostPool * _hpool ,
UserPool * _upool ) :
hpool ( _hpool ) ,
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
_signature = " A:si " ;
_help = " Returns host information " ;
} ;
~ HostInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
HostPool * hpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2009-07-09 18:34:34 +04:00
class HostPoolInfo : public xmlrpc_c : : method
{
public :
HostPoolInfo ( HostPool * _hpool ,
UserPool * _upool ) :
hpool ( _hpool ) ,
upool ( _upool )
{
_signature = " A:s " ;
_help = " Returns the host pool information " ;
} ;
~ HostPoolInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
2008-06-17 20:27:32 +04:00
2009-07-09 18:34:34 +04:00
private :
HostPool * hpool ;
UserPool * upool ;
2008-06-17 20:27:32 +04:00
} ;
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
class HostDelete : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
HostDelete (
HostPool * _hpool ,
UserPool * _upool ) :
hpool ( _hpool ) ,
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
_signature = " A:si " ;
_help = " Deletes a host from the pool " ;
} ;
~ HostDelete ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
HostPool * hpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2008-06-17 20:27:32 +04:00
} ;
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2008-06-17 20:27:32 +04:00
class HostEnable : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
HostEnable (
HostPool * _hpool ,
UserPool * _upool ) :
hpool ( _hpool ) ,
upool ( _upool )
2008-06-17 20:27:32 +04:00
{
_signature = " A:sib " ;
_help = " Enables or disables a host " ;
} ;
~ HostEnable ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
HostPool * hpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2010-08-05 21:28:28 +04:00
} ;
2010-07-08 19:26:25 +04:00
/* ---------------------------------------------------------------------- */
/* Cluster Interface */
/* ---------------------------------------------------------------------- */
class ClusterAllocate : public xmlrpc_c : : method
{
public :
ClusterAllocate (
2011-03-14 21:06:39 +03:00
UserPool * _upool ,
ClusterPool * _cpool ) :
upool ( _upool ) ,
cpool ( _cpool )
2010-07-08 19:26:25 +04:00
{
_signature = " A:ss " ;
_help = " Allocates a cluster in the pool " ;
} ;
~ ClusterAllocate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
2011-03-14 21:06:39 +03:00
UserPool * upool ;
ClusterPool * cpool ;
2010-07-08 19:26:25 +04:00
} ;
/* ---------------------------------------------------------------------- */
class ClusterInfo : public xmlrpc_c : : method
{
public :
ClusterInfo (
2011-03-14 21:06:39 +03:00
UserPool * _upool ,
ClusterPool * _cpool ) :
upool ( _upool ) ,
cpool ( _cpool )
2010-07-08 19:26:25 +04:00
{
_signature = " A:si " ;
_help = " Returns cluster information " ;
} ;
~ ClusterInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
2011-03-14 21:06:39 +03:00
UserPool * upool ;
ClusterPool * cpool ;
2010-07-08 19:26:25 +04:00
} ;
/* ---------------------------------------------------------------------- */
class ClusterDelete : public xmlrpc_c : : method
{
public :
ClusterDelete (
2011-03-14 21:06:39 +03:00
UserPool * _upool ,
ClusterPool * _cpool ) :
upool ( _upool ) ,
cpool ( _cpool )
2010-07-08 19:26:25 +04:00
{
_signature = " A:si " ;
_help = " Deletes a cluster from the pool " ;
} ;
~ ClusterDelete ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
2011-03-14 21:06:39 +03:00
UserPool * upool ;
ClusterPool * cpool ;
2010-07-08 19:26:25 +04:00
} ;
/* ---------------------------------------------------------------------- */
class ClusterAdd : public xmlrpc_c : : method
{
public :
ClusterAdd (
2011-03-14 21:06:39 +03:00
HostPool * _hpool ,
UserPool * _upool ,
ClusterPool * _cpool ) :
2010-07-08 19:26:25 +04:00
hpool ( _hpool ) ,
2011-03-14 21:06:39 +03:00
upool ( _upool ) ,
cpool ( _cpool )
2010-07-08 19:26:25 +04:00
{
_signature = " A:sii " ;
_help = " Adds a host to a cluster " ;
} ;
~ ClusterAdd ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
2011-03-14 21:06:39 +03:00
HostPool * hpool ;
UserPool * upool ;
ClusterPool * cpool ;
2010-07-08 19:26:25 +04:00
} ;
/* ---------------------------------------------------------------------- */
class ClusterRemove : public xmlrpc_c : : method
{
public :
ClusterRemove (
2011-03-14 21:06:39 +03:00
HostPool * _hpool ,
UserPool * _upool ,
ClusterPool * _cpool ) :
2010-07-08 19:26:25 +04:00
hpool ( _hpool ) ,
2011-03-14 21:06:39 +03:00
upool ( _upool ) ,
cpool ( _cpool )
2010-07-08 19:26:25 +04:00
{
_signature = " A:si " ;
_help = " Removes a host from its cluster " ;
} ;
~ ClusterRemove ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
2011-03-14 21:06:39 +03:00
HostPool * hpool ;
UserPool * upool ;
ClusterPool * cpool ;
2010-07-08 19:26:25 +04:00
} ;
/* ---------------------------------------------------------------------- */
class ClusterPoolInfo : public xmlrpc_c : : method
{
public :
ClusterPoolInfo (
2011-03-14 21:06:39 +03:00
UserPool * _upool ,
ClusterPool * _cpool ) :
upool ( _upool ) ,
cpool ( _cpool )
2010-07-08 19:26:25 +04:00
{
_signature = " A:s " ;
_help = " Returns the cluster pool information " ;
} ;
~ ClusterPoolInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
2011-03-14 21:06:39 +03:00
UserPool * upool ;
ClusterPool * cpool ;
2010-07-08 19:26:25 +04:00
} ;
2011-05-10 20:45:15 +04:00
/* ---------------------------------------------------------------------- */
/* Group Interface */
/* ---------------------------------------------------------------------- */
class GroupAllocate : public xmlrpc_c : : method
{
public :
GroupAllocate (
UserPool * _upool ,
GroupPool * _gpool ) :
upool ( _upool ) ,
gpool ( _gpool )
{
_signature = " A:ss " ;
_help = " Allocates a group in the pool " ;
} ;
~ GroupAllocate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
UserPool * upool ;
GroupPool * gpool ;
} ;
/* ---------------------------------------------------------------------- */
class GroupInfo : public xmlrpc_c : : method
{
public :
GroupInfo (
UserPool * _upool ,
GroupPool * _gpool ) :
upool ( _upool ) ,
gpool ( _gpool )
{
_signature = " A:si " ;
_help = " Returns group information " ;
} ;
~ GroupInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
UserPool * upool ;
GroupPool * gpool ;
} ;
/* ---------------------------------------------------------------------- */
class GroupDelete : public xmlrpc_c : : method
{
public :
GroupDelete (
UserPool * _upool ,
GroupPool * _gpool ) :
upool ( _upool ) ,
gpool ( _gpool )
{
_signature = " A:si " ;
_help = " Deletes a group from the pool " ;
} ;
~ GroupDelete ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
UserPool * upool ;
GroupPool * gpool ;
} ;
/* ---------------------------------------------------------------------- */
class GroupPoolInfo : public xmlrpc_c : : method
{
public :
GroupPoolInfo (
UserPool * _upool ,
GroupPool * _gpool ) :
upool ( _upool ) ,
gpool ( _gpool )
{
_signature = " A:s " ;
_help = " Returns the group pool information " ;
} ;
~ GroupPoolInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
UserPool * upool ;
GroupPool * gpool ;
} ;
2008-11-13 19:21:17 +03:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
/* Virtual Network Interface */
2008-11-13 19:21:17 +03:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2008-11-13 19:21:17 +03:00
class VirtualNetworkAllocate : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
VirtualNetworkAllocate (
VirtualNetworkPool * _vnpool ,
UserPool * _upool ) :
vnpool ( _vnpool ) ,
upool ( _upool )
2008-11-13 19:21:17 +03:00
{
_signature = " A:ss " ;
_help = " Creates a virtual network " ;
} ;
~ VirtualNetworkAllocate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VirtualNetworkPool * vnpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2010-08-05 21:28:28 +04:00
} ;
2008-11-13 19:21:17 +03:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2008-11-13 19:21:17 +03:00
class VirtualNetworkInfo : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
VirtualNetworkInfo (
VirtualNetworkPool * _vnpool ,
UserPool * _upool ) :
vnpool ( _vnpool ) ,
upool ( _upool )
2008-11-13 19:21:17 +03:00
{
_signature = " A:si " ;
_help = " Returns virtual network information " ;
} ;
~ VirtualNetworkInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
2010-08-05 21:28:28 +04:00
2008-11-13 19:21:17 +03:00
private :
VirtualNetworkPool * vnpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
2008-11-13 19:21:17 +03:00
} ;
2010-08-05 21:28:28 +04:00
2009-07-09 18:34:34 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2009-07-09 18:34:34 +04:00
class VirtualNetworkPoolInfo : public xmlrpc_c : : method
{
public :
VirtualNetworkPoolInfo ( VirtualNetworkPool * _vnpool ,
UserPool * _upool ) :
vnpool ( _vnpool ) ,
upool ( _upool )
{
_signature = " A:si " ;
_help = " Returns the virtual network pool information " ;
} ;
~ VirtualNetworkPoolInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VirtualNetworkPool * vnpool ;
UserPool * upool ;
} ;
2010-08-05 21:28:28 +04:00
2010-06-29 21:40:03 +04:00
/* ---------------------------------------------------------------------- */
class VirtualNetworkPublish : public xmlrpc_c : : method
{
public :
VirtualNetworkPublish (
VirtualNetworkPool * _vnpool ,
UserPool * _upool ) :
vnpool ( _vnpool ) ,
upool ( _upool )
{
_signature = " A:sib " ;
_help = " Enables/Disables a virtual network " ;
} ;
~ VirtualNetworkPublish ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VirtualNetworkPool * vnpool ;
UserPool * upool ;
} ;
2009-07-09 18:34:34 +04:00
2008-11-13 19:21:17 +03:00
/* ---------------------------------------------------------------------- */
class VirtualNetworkDelete : public xmlrpc_c : : method
{
public :
2009-07-09 18:34:34 +04:00
VirtualNetworkDelete (
VirtualNetworkPool * _vnpool ,
UserPool * _upool ) :
vnpool ( _vnpool ) ,
upool ( _upool )
2008-11-13 19:21:17 +03:00
{
_signature = " A:si " ;
_help = " Deletes a virtual network " ;
} ;
~ VirtualNetworkDelete ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VirtualNetworkPool * vnpool ;
2009-07-09 18:34:34 +04:00
UserPool * upool ;
} ;
2011-02-01 20:26:26 +03:00
/* ---------------------------------------------------------------------- */
class VirtualNetworkAddLeases : public xmlrpc_c : : method
{
public :
VirtualNetworkAddLeases (
VirtualNetworkPool * _vnpool ,
UserPool * _upool ) :
vnpool ( _vnpool ) ,
upool ( _upool )
{
_signature = " A:sis " ;
_help = " Adds leases to a virtual network " ;
} ;
~ VirtualNetworkAddLeases ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VirtualNetworkPool * vnpool ;
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
class VirtualNetworkRemoveLeases : public xmlrpc_c : : method
{
public :
VirtualNetworkRemoveLeases (
VirtualNetworkPool * _vnpool ,
UserPool * _upool ) :
vnpool ( _vnpool ) ,
upool ( _upool )
{
_signature = " A:sis " ;
_help = " Removes leases from a virtual network " ;
} ;
~ VirtualNetworkRemoveLeases ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
VirtualNetworkPool * vnpool ;
UserPool * upool ;
} ;
2009-07-09 18:34:34 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
/* User Management Interface */
2009-07-09 18:34:34 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2009-07-09 18:34:34 +04:00
class UserAllocate : public xmlrpc_c : : method
{
public :
UserAllocate ( UserPool * _upool ) : upool ( _upool )
{
_signature = " A:sss " ;
_help = " Creates a new user " ;
} ;
~ UserAllocate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
2008-11-13 19:21:17 +03:00
2009-07-09 18:34:34 +04:00
private :
UserPool * upool ;
2008-11-13 19:21:17 +03:00
} ;
2008-06-17 20:27:32 +04:00
2009-07-09 18:34:34 +04:00
/* ---------------------------------------------------------------------- */
class UserDelete : public xmlrpc_c : : method
{
public :
UserDelete ( UserPool * _upool ) : upool ( _upool )
{
_signature = " A:si " ;
_help = " Deletes a user account " ;
} ;
~ UserDelete ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
UserPool * upool ;
} ;
2010-07-20 16:20:43 +04:00
/* ---------------------------------------------------------------------- */
class UserChangePassword : public xmlrpc_c : : method
{
public :
UserChangePassword ( UserPool * _upool ) : upool ( _upool )
{
_signature = " A:sis " ;
_help = " Changes the password for the given user. " ;
} ;
~ UserChangePassword ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
UserPool * upool ;
} ;
2009-07-09 18:34:34 +04:00
/* ---------------------------------------------------------------------- */
2010-10-15 19:29:58 +04:00
class UserInfo : public xmlrpc_c : : method
{
public :
UserInfo ( UserPool * _upool ) : upool ( _upool )
{
_signature = " A:si " ;
_help = " Returns the information for a user " ;
} ;
~ UserInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
UserPool * upool ;
} ;
/* ---------------------------------------------------------------------- */
2009-07-09 18:34:34 +04:00
class UserPoolInfo : public xmlrpc_c : : method
{
public :
UserPoolInfo ( UserPool * _upool ) : upool ( _upool )
{
_signature = " A:s " ;
2010-06-02 21:41:05 +04:00
_help = " Returns content of the user pool " ;
2009-07-09 18:34:34 +04:00
} ;
~ UserPoolInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
UserPool * upool ;
} ;
2010-08-05 21:28:28 +04:00
2010-05-31 20:40:38 +04:00
/* ---------------------------------------------------------------------- */
/* Image Pool Interface */
/* ---------------------------------------------------------------------- */
class ImageAllocate : public xmlrpc_c : : method
{
public :
2010-06-02 21:41:05 +04:00
ImageAllocate ( ImagePool * _ipool ,
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
2010-05-31 20:40:38 +04:00
{
2010-06-02 21:41:05 +04:00
_signature = " A:ss " ;
_help = " Creates a new image " ;
2010-05-31 20:40:38 +04:00
} ;
2010-06-01 20:00:44 +04:00
~ ImageAllocate ( ) { } ;
2010-05-31 20:40:38 +04:00
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
2010-06-02 21:41:05 +04:00
ImagePool * ipool ;
UserPool * upool ;
2010-08-05 21:28:28 +04:00
} ;
2010-06-08 19:42:18 +04:00
/* ---------------------------------------------------------------------- */
2010-08-05 21:28:28 +04:00
2010-06-08 19:42:18 +04:00
class ImageDelete : public xmlrpc_c : : method
{
public :
ImageDelete ( ImagePool * _ipool ,
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
{
_signature = " A:si " ;
_help = " Deletes an image " ;
} ;
~ ImageDelete ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
ImagePool * ipool ;
UserPool * upool ;
2010-08-05 21:28:28 +04:00
} ;
2010-06-01 20:00:44 +04:00
/* ---------------------------------------------------------------------- */
class ImageInfo : public xmlrpc_c : : method
{
public :
ImageInfo ( ImagePool * _ipool ,
2010-06-01 21:35:42 +04:00
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
2010-06-01 20:00:44 +04:00
{
2010-06-08 19:42:18 +04:00
_signature = " A:si " ;
_help = " Returns information for an image " ;
2010-06-01 20:00:44 +04:00
} ;
~ ImageInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
ImagePool * ipool ;
UserPool * upool ;
2010-08-05 21:28:28 +04:00
} ;
2010-05-31 20:40:38 +04:00
/* ---------------------------------------------------------------------- */
2010-06-10 20:54:48 +04:00
class ImageUpdate : public xmlrpc_c : : method
{
public :
ImageUpdate ( ImagePool * _ipool ,
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
{
_signature = " A:siss " ;
_help = " Modifies image attribute " ;
} ;
~ ImageUpdate ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
2010-06-24 20:50:41 +04:00
private :
ImagePool * ipool ;
UserPool * upool ;
} ;
2010-08-05 21:28:28 +04:00
2010-06-24 20:50:41 +04:00
/* ---------------------------------------------------------------------- */
class ImageRemoveAttribute : public xmlrpc_c : : method
{
public :
ImageRemoveAttribute ( ImagePool * _ipool ,
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
{
_signature = " A:sis " ;
_help = " Removes image attribute " ;
} ;
~ ImageRemoveAttribute ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
ImagePool * ipool ;
UserPool * upool ;
} ;
2010-08-05 21:28:28 +04:00
2010-06-24 20:50:41 +04:00
/* ---------------------------------------------------------------------- */
class ImagePublish : public xmlrpc_c : : method
{
public :
ImagePublish ( ImagePool * _ipool ,
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
{
_signature = " A:sib " ;
2010-06-28 14:17:21 +04:00
_help = " Publish/Unpublish the Image " ;
2010-06-24 20:50:41 +04:00
} ;
~ ImagePublish ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
ImagePool * ipool ;
UserPool * upool ;
} ;
2010-08-05 21:28:28 +04:00
2010-06-24 20:50:41 +04:00
/* ---------------------------------------------------------------------- */
2010-08-03 21:22:13 +04:00
class ImagePersistent : public xmlrpc_c : : method
{
public :
ImagePersistent ( ImagePool * _ipool ,
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
{
_signature = " A:sib " ;
_help = " Make an Image (non)persistent " ;
} ;
~ ImagePersistent ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
ImagePool * ipool ;
UserPool * upool ;
} ;
2010-08-05 21:28:28 +04:00
2010-08-03 21:22:13 +04:00
/* ---------------------------------------------------------------------- */
2010-06-24 20:50:41 +04:00
class ImageEnable : public xmlrpc_c : : method
{
public :
ImageEnable ( ImagePool * _ipool ,
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
{
_signature = " A:sib " ;
2010-06-28 14:17:21 +04:00
_help = " Enables/Disables the Image " ;
2010-06-24 20:50:41 +04:00
} ;
~ ImageEnable ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
2010-06-10 20:54:48 +04:00
private :
ImagePool * ipool ;
UserPool * upool ;
} ;
2010-08-05 21:28:28 +04:00
2010-06-10 20:54:48 +04:00
/* ---------------------------------------------------------------------- */
2010-05-31 20:40:38 +04:00
class ImagePoolInfo : public xmlrpc_c : : method
{
public :
ImagePoolInfo ( ImagePool * _ipool ,
UserPool * _upool ) :
ipool ( _ipool ) ,
upool ( _upool )
{
2010-06-02 21:41:05 +04:00
_signature = " A:si " ;
_help = " Returns content of image pool attending to the filter flag " ;
2010-05-31 20:40:38 +04:00
} ;
~ ImagePoolInfo ( ) { } ;
void execute (
xmlrpc_c : : paramList const & paramList ,
xmlrpc_c : : value * const retvalP ) ;
private :
ImagePool * ipool ;
UserPool * upool ;
2010-06-01 20:00:44 +04:00
} ;
2010-06-01 21:35:42 +04:00
} ;
2010-08-05 21:28:28 +04:00
2010-05-31 20:40:38 +04:00
2008-06-17 20:27:32 +04:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif