Revision f3fc078b include/RequestManager.h

View differences:

include/RequestManager.h
173 173
    // ----------------------------------------------------------------------
174 174
    // ----------------------------------------------------------------------   
175 175
    
176
    
177
    /**
178
     *  Logs authorization errors
179
     *    @param method name of the RM method where the error arose
180
     *    @param action authorization action
181
     *    @param object object that needs to be authorized
182
     *    @param uid user that is authorized
183
     *    @param id id of the object, -1 for Pool
184
     *    @returns string for logging
185
     */
176 186
    static string authorization_error (const string& method, 
177 187
                                       const string &action, 
178 188
                                       const string &object, 
......
180 190
                                       int   id)
181 191
    {
182 192
        ostringstream oss;
183
        oss << "[" << method << "]" << " User [" << uid << "] not authorized "               
193
        oss << "[" << method << "]" << " User [" << uid << "] not authorized"               
184 194
            << " to perform " << action << " on " << object; 
185 195
            
186 196
        
......
196 206
        return oss.str();
197 207
    }
198 208
    
209
    /**
210
     *  Logs authenticate errors
211
     *    @param method name of the RM method where the error arose
212
     *    @returns string for logging
213
     */   
199 214
    static string authenticate_error (const string& method)
200 215
    {
201 216
        ostringstream oss;
......
205 220
      
206 221
        return oss.str();
207 222
    }
208

  
223
    
224
    /**
225
     *  Logs get object errors
226
     *    @param method name of the RM method where the error arose
227
     *    @param object over which the get failed
228
     *    @param id of the object over which the get failed
229
     *    @returns string for logging
230
     */
209 231
    static string get_error (const string& method, 
210 232
                             const string &object, 
211 233
                             int id)
......
227 249
       return oss.str();
228 250
    }
229 251
    
252
    /**
253
     *  Logs action errors
254
     *    @param method name of the RM method where the error arose
255
     *    @param action that triggered the error
256
     *    @param object over which the action was applied
257
     *    @param id id of the object, -1 for Pool, -2 for no-id objects   
258
     *              (allocate error, parse error)
259
     *    @param rc returned error code (NULL to ignore)
260
     *    @returns string for logging
261
     */
230 262
    static string action_error (const string& method,
231 263
                                const string &action, 
232 264
                                const string &object, 
......
271 303
    {
272 304
    public:
273 305
        VirtualMachineAllocate(
274
            UserPool * _upool):
275
		upool(_upool)
306
            VirtualMachinePool * _vmpool,
307
            VirtualNetworkPool * _vnpool,
308
            ImagePool          * _ipool,
309
            UserPool           * _upool):
310
        vmpool(_vmpool),
311
        vnpool(_vnpool),
312
        ipool(_ipool),
313
        upool(_upool)
276 314
        {
277 315
            _signature="A:ss";
278 316
            _help="Allocates a virtual machine in the pool";
......
284 322
            xmlrpc_c::paramList const& paramList,
285 323
            xmlrpc_c::value *   const  retval);
286 324
    private:
325
        VirtualMachinePool * vmpool;
326
        VirtualNetworkPool * vnpool;
327
        ImagePool          * ipool;
287 328
        UserPool           * upool;
288 329
    };
289 330
    
......
294 335
    public:
295 336
        VirtualMachineDeploy(
296 337
            VirtualMachinePool * _vmpool,
297
            HostPool *           _hpool,
298
            UserPool *           _upool):
338
            HostPool           * _hpool,
339
            UserPool           * _upool):
299 340
                vmpool(_vmpool),
300 341
                hpool(_hpool),
301 342
                upool(_upool)

Also available in: Unified diff