/* -------------------------------------------------------------------------- */ /* Copyright 2002-2022, OpenNebula Project, OpenNebula Systems */ /* */ /* 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_ALLOCATE_H_ #define REQUEST_MANAGER_ALLOCATE_H_ #include "Request.h" #include "Nebula.h" #include "VirtualNetworkTemplate.h" #include "ImageTemplate.h" #include "VirtualMachineTemplate.h" #include "DatastoreTemplate.h" #include "MarketPlaceTemplate.h" #include "ClusterPool.h" #include "DatastorePool.h" #include "DocumentPool.h" #include "HookPool.h" #include "HostPool.h" #include "ImagePool.h" #include "MarketPlacePool.h" #include "MarketPlaceAppPool.h" #include "SecurityGroupPool.h" #include "VdcPool.h" #include "VirtualMachinePool.h" #include "VirtualNetworkPool.h" #include "VirtualRouterPool.h" #include "VMGroupPool.h" #include "VMTemplatePool.h" #include "VNTemplatePool.h" #include "ZonePool.h" /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */ class RequestManagerAllocate: public Request { protected: RequestManagerAllocate(const std::string& method_name, const std::string& help, const std::string& xml_args, bool _do_template) :Request(method_name,xml_args,help), do_template(_do_template) { auth_op = AuthRequest::CREATE; Nebula& nd = Nebula::instance(); clpool = nd.get_clpool(); }; ~RequestManagerAllocate(){}; /* -------------------------------------------------------------------- */ void request_execute(xmlrpc_c::paramList const& _paramList, RequestAttributes& att) override; virtual bool allocate_authorization(xmlrpc_c::paramList const& _paramList, Template *obj_template, RequestAttributes& att, PoolObjectAuth *cluster_perms); /* -------------------------------------------------------------------- */ virtual std::unique_ptr