2011-06-02 02:55:43 +04:00
/* -------------------------------------------------------------------------- */
2012-01-12 15:29:18 +04:00
/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */
2011-06-02 02:55:43 +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_UPDATE_TEMPLATE_H
# define REQUEST_MANAGER_UPDATE_TEMPLATE_H
# include "Request.h"
# include "Nebula.h"
using namespace std ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class RequestManagerUpdateTemplate : public Request
{
protected :
RequestManagerUpdateTemplate ( const string & method_name ,
const string & help )
: Request ( method_name , " A:sis " , help )
{
auth_op = AuthRequest : : MANAGE ;
} ;
~ RequestManagerUpdateTemplate ( ) { } ;
/* -------------------------------------------------------------------- */
2011-07-07 14:45:13 +04:00
void request_execute ( xmlrpc_c : : paramList const & _paramList ,
RequestAttributes & att ) ;
2011-06-02 02:55:43 +04:00
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class TemplateUpdateTemplate : public RequestManagerUpdateTemplate
{
public :
TemplateUpdateTemplate ( ) :
RequestManagerUpdateTemplate ( " TemplateUpdateTemplate " ,
" Updates a virtual machine template " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_tpool ( ) ;
2012-01-03 05:58:23 +04:00
auth_object = PoolObjectSQL : : TEMPLATE ;
2011-06-02 02:55:43 +04:00
} ;
~ TemplateUpdateTemplate ( ) { } ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class ImageUpdateTemplate : public RequestManagerUpdateTemplate
{
public :
ImageUpdateTemplate ( ) :
RequestManagerUpdateTemplate ( " ImageUpdateTemplate " ,
" Updates an image template " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_ipool ( ) ;
2012-01-03 05:58:23 +04:00
auth_object = PoolObjectSQL : : IMAGE ;
2011-06-02 02:55:43 +04:00
} ;
~ ImageUpdateTemplate ( ) { } ;
} ;
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class HostUpdateTemplate : public RequestManagerUpdateTemplate
{
public :
HostUpdateTemplate ( ) :
RequestManagerUpdateTemplate ( " HostUpdateTemplate " ,
" Updates a host template " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_hpool ( ) ;
2012-01-03 05:58:23 +04:00
auth_object = PoolObjectSQL : : HOST ;
2011-06-02 02:55:43 +04:00
} ;
~ HostUpdateTemplate ( ) { } ;
} ;
2011-10-11 01:06:13 +04:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class VirtualNetworkUpdateTemplate : public RequestManagerUpdateTemplate
{
public :
VirtualNetworkUpdateTemplate ( ) :
RequestManagerUpdateTemplate ( " VirtualNetworkUpdateTemplate " ,
" Updates a vnet template " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_vnpool ( ) ;
2012-01-03 05:58:23 +04:00
auth_object = PoolObjectSQL : : NET ;
2011-10-11 01:06:13 +04:00
} ;
~ VirtualNetworkUpdateTemplate ( ) { } ;
} ;
2011-10-11 02:20:50 +04:00
/* ------------------------------------------------------------------------- */
/* ------------------------------------------------------------------------- */
class UserUpdateTemplate : public RequestManagerUpdateTemplate
{
public :
UserUpdateTemplate ( ) :
RequestManagerUpdateTemplate ( " UserUpdateTemplate " ,
" Updates a user template " )
{
Nebula & nd = Nebula : : instance ( ) ;
pool = nd . get_upool ( ) ;
2012-01-03 05:58:23 +04:00
auth_object = PoolObjectSQL : : USER ;
2011-10-11 02:20:50 +04:00
} ;
~ UserUpdateTemplate ( ) { } ;
} ;
2011-06-02 02:55:43 +04:00
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
# endif