Ejemplo n.º 1
0
 /**
  * Returns the URL Alias of the API Class that inherits the Class ONAPP
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_EDIT:
             /**
              * ROUTE :
              *
              * @name
              * @method PUT
              * @alias  /settings(.:format)
              * @format settings#update
              */
             $resource = $this->_resource;
             break;
         case ONAPP_GETRESOURCE_LIST:
             /**
              * ROUTE :
              *
              * @name configuration_settings
              * @method GET
              * @alias     /settings/configuration(.:format)
              * @format    settings#configuration
              */
             $resource = $this->_resource . '/configuration';
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 2
0
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_LOAD:
             $resource = 'cdn_resources/' . $this->_id . '/' . $this->_resource;
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 3
0
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     return parent::getResource($action);
     /**
      * ROUTE :
      *
      * @name user_data_store_groups
      * @method GET
      * @alias  /data_store_zones(.:format)
      * @format {:controller=>"data_store_groups", :action=>"index"}
      */
     /**
      * ROUTE :
      *
      * @name user_data_store_group
      * @method GET
      * @alias   /data_store_zones/:id(.:format)
      * @format  {:controller=>"data_store_groups", :action=>"show"}
      */
     /**
      * ROUTE :
      *
      * @name
      * @method POST
      * @alias   /data_store_zones(.:format)
      * @format  {:controller=>"data_store_groups", :action=>"create"}
      */
     /**
      * ROUTE :
      *
      * @name
      * @method PUT
      * @alias  /data_store_zones/:id(.:format)
      * @format {:controller=>"data_store_groups", :action=>"update"}
      */
     /**
      * ROUTE :
      *
      * @name
      * @method DELETE
      * @alias  /data_store_zones/:id(.:format)
      * @format {:controller=>"data_store_groups", :action=>"destroy"}
      */
 }
Ejemplo n.º 4
0
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     return parent::getResource($action);
     /**
      * ROUTE :
      *
      * @name nameservers
      * @method GET
      * @alias   /settings/nameservers(.:format)
      * @format  {:controller=>"nameservers", :action=>"index"}
      */
     /**
      * ROUTE :
      *
      * @name nameserver
      * @method GET
      * @alias   /settings/nameservers/:id(.:format)
      * @format  {:controller=>"nameservers", :action=>"show"}
      */
     /**
      * ROUTE :
      *
      * @name
      * @method POST
      * @alias    /settings/nameservers(.:format)
      * @format   {:controller=>"nameservers", :action=>"create"}
      */
     /**
      * ROUTE :
      *
      * @name
      * @method PUT
      * @alias  /settings/nameservers/:id(.:format)
      * @format {:controller=>"nameservers", :action=>"update"}
      */
     /**
      * ROUTE :
      *
      * @name
      * @method DELETE
      * @alias    /settings/nameservers/:id(.:format)
      * @format   {:controller=>"nameservers", :action=>"destroy"}
      */
 }
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_NETWORKS_LIST_BY_HYPERVISOR_GROUP_ID:
             /**
              * ROUTE :
              * @name hypervisor_group_networks
              * @method GET
              * @alias  /settings/hypervisor_zones/:hypervisor_group_id/networks(.:format)
              * @format {:controller=>"networks", :action=>"index"}
              */
             $resource = 'settings/hypervisor_zones/' . $this->_hypervisor_group_id . '/networks';
             break;
         case ONAPP_GETRESOURCE_IP_ADDRESSES:
             /**
              * ROUTE :
              * @name network_ip_addresses
              * @method GET
              * @alias  /settings/networks/:network_id/ip_addresses(.:format)
              * @format {:controller=>"ip_addresses", :action=>"index"}
              */
             $resource = $this->_resource . '/' . $this->_id . '/ip_address';
             break;
         default:
             /**
              * ROUTE :
              * @name networks
              * @method GET
              * @alias  /settings/networks(.:format)
              * @format {:controller=>"networks", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name network
              * @method GET
              * @alias   /settings/networks/:id(.:format)
              * @format  {:controller=>"networks", :action=>"show"}
              */
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              * @name hypervisor_data_store_joins
              * @method GET
              * @alias   /settings/hyrvisor_zones/:hypervisor_id/data_store_joins(.:format)
              * @format  {:controller=>"data_store_joins", :action=>"index"}
              */
             $resource = 'settings/hypervisor_zones/' . $this->_target_join_id . '/' . $this->_resource;
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_HYPERVISORS_BY_HYPERVISOR_GROUP_ID:
             /**
              * ROUTE :
              * @name hypervisor_group_hypervisors
              * @method GET
              * @alias  /settings/hypervisor_zones/:hypervisor_group_id/hypervisors(.:format)
              * @format {:controller=>"hypervisors", :action=>"index"}
              */
             $resource = 'settings/hypervisor_zones/' . $this->_hypervisor_group_id . '/hypervisors';
             break;
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              * @name hypervisors
              * @method GET
              * @alias  /settings/hypervisors(.:format)
              * @format {:controller=>"settings_hypervisors", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name hypervisor
              * @method GET
              * @alias   /settings/hypervisors/:id(.:format)
              * @format  {:controller=>"settings_hypervisors", :action=>"show"}
              */
             /**
              * ROUTE :
              * @name
              * @method POST
              * @alias   /settings/hypervisors(.:format)
              * @format  {:controller=>"settings_hypervisors", :action=>"create"}
              */
             /**
              * ROUTE :
              * @name
              * @method PUT
              * @alias  /settings/hypervisors/:id(.:format)
              * @format {:controller=>"settings_hypervisors", :action=>"update"}
              */
             /**
              * ROUTE :
              * @name
              * @method DELETE
              * @alias   /settings/hypervisors/:id(.:format)
              * @format  {:controller=>"settings_hypervisors", :action=>"destroy"}
              */
             $resource = parent::getResource($action);
             break;
         case ONAPP_GETRESOURCE_HYPERVISOR_REBOOT:
             /**
              * ROUTE :
              * @name reboot_hypervisor
              * @method POST
              * @alias   /settings/hypervisors/:id/reboot(.:format)
              * @format  {:action=>"reboot", :controller=>"settings_hypervisors"}
              */
             $resource = $this->_resource . '/' . $this->_id . '/reboot';
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 8
0
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              * @name log_items
              * @method GET
              * @alias   /logs(.:format)
              * @format  {:controller=>"log_items", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name log_item
              * @method GET
              * @alias    /logs/:id(.:format)
              * @format   {:controller=>"log_items", :action=>"show"}
              */
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $this->_resource);
             break;
         default:
             $this->_resource = parent::getResource($action);
             break;
     }
     return $this->_resource;
 }
Ejemplo n.º 9
0
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_REBOOT:
             /**
              * ROUTE :
              *
              * @name reboot_virtual_machine
              * @method POST
              * @alias    /virtual_machines/:id/reboot(.:format)
              * @format   {:controller=>"virtual_machines", :action=>"reboot"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/reboot';
             break;
         case ONAPP_GETRESOURCE_SHUTDOWN:
             /**
              * ROUTE :
              *
              * @name shutdown_virtual_machine
              * @method POST
              * @alias    /virtual_machines/:id/shutdown(.:format)
              * @format   {:controller=>"virtual_machines", :action=>"shutdown"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/shutdown';
             break;
         case ONAPP_GETRESOURCE_CHANGE_OWNER:
             /**
              * ROUTE :
              *
              * @name change_owner_virtual_machine
              * @method POST
              * @alias   /virtual_machines/:id/change_owner(.:format)
              * @format  {:controller=>"virtual_machines", :action=>"change_owner"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/change_owner';
             break;
         case ONAPP_GETRESOURCE_REBUILD_NETWORK:
             /**
              * ROUTE :
              *
              * @name rebuild_network_virtual_machine
              * @method POST
              * @alias   /virtual_machines/:id/rebuild_network(.:format)
              * @format  {:controller=>"virtual_machines", :action=>"rebuild_network"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/rebuild_network';
             break;
         case ONAPP_GETRESOURCE_STARTUP:
             /**
              * ROUTE :
              *
              * @name shutdown_virtual_machine
              * @method POST
              * @alias    /virtual_machines/:id/startup(.:format)
              * @format   {:controller=>"virtual_machines", :action=>"startup"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/startup';
             break;
         case ONAPP_GETRESOURCE_UNLOCK:
             /**
              * ROUTE :
              *
              * @name shutdown_virtual_machine
              * @method POST
              * @alias   /virtual_machines/:id/unlock(.:format)
              * @format  {:controller=>"virtual_machines", :action=>"unlock"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/unlock';
             break;
         case ONAPP_GETRESOURCE_MIGRATE:
             /**
              * ROUTE :
              *
              * @name migrate_virtual_machine
              * @method POST
              * @alias   /virtual_machines/:id/migrate(.:format)
              * @format  {:controller=>"virtual_machines", :action=>"migrate"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/migrate';
             break;
         case ONAPP_GETRESOURCE_SUSPEND_VM:
             /**
              * ROUTE :
              *
              * @name suspend_virtual_machine
              * @method POST
              * @alias   /virtual_machines/:id/suspend(.:format)
              * @format  {:controller=>"virtual_machines", :action=>"suspend"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/suspend';
             break;
         case ONAPP_GETRESOURCE_BUILD:
             /**
              * ROUTE :
              *
              * @name build_virtual_machine
              * @method POST
              * @alias    /virtual_machines/:id/build(.:format)
              * @format   {:controller=>"virtual_machines", :action=>"build"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/build';
             break;
         case ONAPP_RESET_ROOT_PASSWORD:
             /**
              * ROUTE :
              *
              * @name reset_password_virtual_machine
              * @method POST
              * @alias  /virtual_machines/:id/reset_password(.:format)
              * @format {:controller=>"virtual_machines", :action=>"reset_password"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/reset_password';
             break;
         case ONAPP_ACTIVATE_GETLIST_USER:
             /**
              * ROUTE :
              *
              * @name user_virtual_machines
              * @method POST
              * @alias  /users/:user_id/virtual_machines(.:format)
              * @format {:controller=>"virtual_machines", :action=>"index"}
              */
             $resource = '/users/' . $this->_user_id . '/virtual_machines';
             break;
         default:
             /**
              * ROUTE :
              *
              * @name virtual_machines
              * @method GET
              * @alias   /virtual_machines(.:format)
              * @format  {:controller=>"virtual_machines", :action=>"index"}
              */
             /**
              * ROUTE :
              *
              * @name virtual_machine
              * @method GET
              * @alias    /virtual_machines/:id(.:format)
              * @format   {:controller=>"virtual_machines", :action=>"show"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias    /virtual_machines(.:format)
              * @format   {:controller=>"virtual_machines", :action=>"create"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method PUT
              * @alias  /virtual_machines/:id(.:format)
              * @format {:controller=>"virtual_machines", :action=>"update"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method DELETE
              * @alias   /virtual_machines/:id(.:format)
              * @format  {:controller=>"virtual_machines", :action=>"destroy"}
              */
             $resource = parent::getResource($action);
             break;
     }
     $actions = array(ONAPP_GETRESOURCE_REBOOT, ONAPP_GETRESOURCE_SHUTDOWN, ONAPP_GETRESOURCE_STARTUP, ONAPP_GETRESOURCE_UNLOCK, ONAPP_GETRESOURCE_BUILD, ONAPP_ACTIVATE_GETLIST_USER, ONAPP_GETRESOURCE_SUSPEND_VM, ONAPP_RESET_ROOT_PASSWORD);
     if (in_array($action, $actions)) {
         $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     }
     return $resource;
 }
Ejemplo n.º 10
0
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     $show_log_msg = true;
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              *
              * @name virtual_machine_backups
              * @method GET
              * @alias   /virtual_machines/:virtual_machine_id/backups(.:format)
              * @format  {:controller=>"backups", :action=>"index"}
              */
             if (is_null($this->_virtual_machine_id) && is_null($this->_obj->_virtual_machine_id)) {
                 $this->logger->error('getResource( ' . $action . ' ): argument _virtual_machine_id not set.', __FILE__, __LINE__);
             } else {
                 if (is_null($this->_virtual_machine_id)) {
                     $this->_virtual_machine_id = $this->_obj->_virtual_machine_id;
                 }
             }
             if (is_null($this->_network_interface_id) && is_null($this->_obj->_network_interface_id)) {
                 $this->logger->error('getResource( ' . $action . ' ): argument _network_interface_id not set.', __FILE__, __LINE__);
             } else {
                 if (is_null($this->_network_interface_id)) {
                     $this->_network_interface_id = $this->_obj->_network_interface_id;
                 }
             }
             $resource = 'virtual_machines/' . $this->_virtual_machine_id . '/network_interfaces/' . $this->_network_interface_id . '/' . $this->_resource;
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     if ($show_log_msg) {
         $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     }
     return $resource;
 }
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              * @name virtual_machine_vm_stats
              * @method GET
              * @alias  /virtual_machines/:virtual_machine_id/vm_stats(.:format)
              * @format {:controller=>"vm_stats", :action=>"index"}
              */
             if (is_null($this->_virtual_machine_id) && is_null($this->_obj->_virtual_machine_id)) {
                 $this->logger->error("getResource({$action}): argument _virtual_machine_id not set.", __FILE__, __LINE__);
             } else {
                 if (is_null($this->_virtual_machine_id)) {
                     $this->_virtual_machine_id = $this->_obj->_virtual_machine_id;
                 }
             }
             $resource = 'virtual_machines/' . $this->_virtual_machine_id . '/' . $this->_resource;
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              * @name network_interfaces
              * @method GET
              * @alias   /network_interfaces(.:format)
              * @format  {:controller=>"network_interfaces", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name  network_interface
              * @method GET
              * @alias    /network_interfaces/:id(.:format)
              * @format   {:controller=>"network_interfaces", :action=>"show"}
              */
             /**
              * ROUTE :
              * @name
              * @method POST
              * @alias   /network_interfaces(.:format)
              * @format  {:controller=>"network_interfaces", :action=>"create"}
              */
             /**
              * ROUTE :
              * @name
              * @method PUT
              * @alias  /network_interfaces/:id(.:format)
              * @format {:controller=>"network_interfaces", :action=>"update"}
              */
             /**
              * ROUTE :
              * @name
              * @method DELETE
              * @alias   /network_interfaces/:id(.:format)
              * @format  {:controller=>"network_interfaces", :action=>"destroy"}
              */
             if (is_null($this->_virtual_machine_id) && is_null($this->_obj->_virtual_machine_id)) {
                 $this->logger->error("getResource({$action}): argument _virtual_machine_id not set.", __FILE__, __LINE__);
             } else {
                 if (is_null($this->_virtual_machine_id)) {
                     $this->_virtual_machine_id = $this->_obj->_virtual_machine_id;
                 }
             }
             $resource = 'virtual_machines/' . $this->_virtual_machine_id . '/' . $this->_resource;
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 13
0
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     $show_log_msg = true;
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              *
              * @name billing_plan_base_resources
              * @method GET
              * @alias   /billing_plans/:billing_plan_id/base_resources(.:format)
              * @format  {:controller=>"base_resources", :action=>"index"}
              */
             /**
              * ROUTE :
              *
              * @name billing_plan_base_resource
              * @method GET
              * @alias    /billing_plans/:billing_plan_id/base_resources/:id(.:format)
              * @format   {:controller=>"base_resources", :action=>"show"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias   /billing_plans/:billing_plan_id/base_resources(.:format)
              * @format  {:controller=>"base_resources", :action=>"create"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method PUT
              * @alias  /billing_plans/:billing_plan_id/base_resources/:id(.:format)
              * @format {:controller=>"base_resources", :action=>"update"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method DELETE
              * @alias   /billing_plans/:billing_plan_id/base_resources/:id(.:format)
              * @format  {:controller=>"base_resources", :action=>"destroy"}
              */
             if (is_null($this->_billing_plan_id) && is_null($this->_obj->_billing_plan_id)) {
                 $this->logger->error('getResource( ' . $action . ' ): argument _billing_plan_id not set.', __FILE__, __LINE__);
             } else {
                 if (is_null($this->_billing_plan_id)) {
                     $this->_billing_plan_id = $this->_obj->_billing_plan_id;
                 }
             }
             $resource = 'billing_plans/' . $this->_billing_plan_id . '/' . $this->_resource;
             break;
         default:
             $resource = parent::getResource($action);
             $show_log_msg = false;
             break;
     }
     if ($show_log_msg) {
         $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     }
     return $resource;
 }
Ejemplo n.º 14
0
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     $show_log_msg = true;
     switch ($action) {
         case ONAPP_GETRESOURCE_LIST_BY_DISK_ID:
             $resource = 'settings/disks/' . $this->_target_id . '/' . $this->_resource;
             break;
         default:
             $resource = parent::getResource($action);
             $show_log_msg = false;
             break;
     }
     if ($show_log_msg) {
         $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     }
     return $resource;
 }
Ejemplo n.º 15
0
 /**
  * Returns the URL Alias for Load of objects of the API Class that inherits the OnApp class
  *
  * Can be redefined if the API for load objects does not use the default
  * alias (the alias consisting of few fields) the same way as {@link
  * getResource}.
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  *
  * @see    getResource
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_LOAD:
             /**
              * ROUTE :
              *
              * @name
              * @method GET
              * @alias  /console_remote/:remote_key(.:format)
              * @format {:controller=>"virtual_machines", :action=>"console_remote"}
              */
             $resource = "virtual_machines/" . $this->_virtual_machine_id . "/" . $this->_resource;
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 16
0
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     return parent::getResource($action);
     /**
      * ROUTE :
      *
      * @name usage_statistics
      * @method GET
      * @alias   /usage_statistics(.:format)
      * @format  {:controller=>"usage_statistics", :action=>"index"}
      */
 }
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_EDGE_GROUP_ASSIGN_LOCATION:
             /**
              * TODO: ADD ROUTE
              *
              *
              *
              *
              */
             $resource = $this->getResource() . '/' . $this->_id . '/assign';
             break;
         case ONAPP_GETRESOURCE_EDGE_GROUP_UNASSIGN_LOCATION:
             /**
              * TODO: ADD ROUTE
              *
              *
              *
              *
              */
             $resource = $this->getResource() . '/' . $this->_id . '/unassign';
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     return $resource;
 }
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_GETLIST_BY_USER_ID:
             /**
              * ROUTE :
              * @name user_load_balancing_clusters
              * @method GET
              * @alias  /users/:user_id/load_balancing_clusters(.:format)
              * @format {:controller=>"load_balancing_clusters", :action=>"index"}
              */
             $resource = 'users/' . $this->_user_id . '/load_balancing_clusters';
             break;
         default:
             /**
              * ROUTE :
              * @name load_balancing_clusters
              * @method GET
              * @alias   /load_balancing_clusters(.:format)
              * @format  {:controller=>"load_balancing_clusters", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name load_balancing_cluster
              * @method GET
              * @alias  /load_balancing_clusters/:id(.:format)
              * @format {:controller=>"load_balancing_clusters", :action=>"show"}
              */
             /**
              * ROUTE :
              * @name
              * @method POST
              * @alias  /load_balancing_clusters(.:format)
              * @format {:controller=>"load_balancing_clusters", :action=>"create"}
              */
             /**
              * ROUTE :
              * @name
              * @method PUT
              * @alias  /load_balancing_clusters/:id(.:format)
              * @format {:controller=>"load_balancing_clusters", :action=>"update"}
              */
             /**
              * ROUTE :
              * @name
              * @method DELETE
              * @alias  /load_balancing_clusters/:id(.:format)
              * @format {:controller=>"load_balancing_clusters", :action=>"destroy"}
              */
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GET_USERTEMPLATES_LIST:
         case 'user':
             $resource = $this->getResource(ONAPP_GETRESOURCE_LIST) . '/' . ONAPP_GET_USERTEMPLATES_LIST;
             break;
         default:
             /**
              * ROUTE :
              * @name image_templates
              * @method GET
              * @alias   /templates(.:format)
              * @format  {:controller=>"image_templates", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name image_template
              * @method GET
              * @alias   /templates/:id(.:format)
              * @format  {:controller=>"image_templates", :action=>"show"}
              */
             /**
              * ROUTE :
              * @name
              * @method DELETE
              * @alias    /templates/:id(.:format)
              * @format   {:controller=>"image_templates", :action=>"destroy"}
              */
             $resource = parent::getResource($action);
     }
     return $resource;
 }
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              * @name hypervisor_network_joins
              * @method GET
              * @alias   /settings/hypervisors/:hypervisor_id/network_joins(.:format)
              * @format  {:controller=>"network_joins", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name
              * @method POST
              * @alias   /settings/hypervisors/:hypervisor_id/network_joins(.:format)
              * @format  {:controller=>"network_joins", :action=>"create"}
              */
             /**
              * ROUTE :
              * @name  hypervisor_network_join
              * @method DELETE
              * @alias   /settings/hypervisors/:hypervisor_id/network_joins/:id(.:format)
              * @format  {:controller=>"network_joins", :action=>"destroy"}
              */
             if (is_null($this->_hypervisor_id) && is_null($this->_obj->_hypervisor_id)) {
                 $this->logger->error('getResource( ' . $action . ' ): argument _hypervisor_id not set.', __FILE__, __LINE__);
             } else {
                 if (is_null($this->_hypervisor_id)) {
                     $this->_hypervisor_id = $this->_obj->_hypervisor_id;
                 }
             }
             $resource = 'settings/hypervisors/' . $this->_hypervisor_id . '/' . $this->_resource;
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 21
0
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_LIST:
             /**
              * ROUTE :
              *
              * @name virtual_machine_disks
              * @method GET
              * @alias  /virtual_machines/:virtual_machine_id/disks(.:format)
              * @format {:controller=>"disks", :action=>"index"}
              */
             $resource = $this->_virtual_machine_id ? 'virtual_machines/' . $this->_virtual_machine_id . '/disks' : $this->getResource();
             break;
         case ONAPP_GETRESOURCE_ADD:
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias     /virtual_machines/:virtual_machine_id/disks(.:format)
              * @format    {:controller=>"disks", :action=>"create"}
              */
             if (is_null($this->_virtual_machine_id)) {
                 $this->logger->error('getResource( ' . $action . ' ): argument _virtual_machine_id not set.', __FILE__, __LINE__);
             } else {
                 $resource = 'virtual_machines/' . $this->_virtual_machine_id . '/disks';
             }
             break;
         case ONAPP_GETRESOURCE_AUTOBACKUP_ENABLE:
             /**
              * ROUTE :
              *
              * @name autobackup_enable_disk
              * @method POST
              * @alias     /settings/disks/:id/autobackup_enable(.:format)
              * @format    {:controller=>"disks", :action=>"autobackup_enable"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/autobackup_enable';
             break;
         case ONAPP_GETRESOURCE_AUTOBACKUP_DISABLE:
             /**
              * ROUTE :
              *
              * @name autobackup_disable_disk
              * @method POST
              * @alias  /settings/disks/:id/autobackup_disable(.:format)
              * @format {:controller=>"disks", :action=>"autobackup_disable"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/autobackup_disable';
             break;
         case ONAPP_GETRESOURCE_TAKE_BACKUP:
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias  /settings/disks/:disk_id/backups(.:format)
              * @format {:controller=>"backups", :action=>"create"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/backups';
             break;
         case ONAPP_GETRESOURCE_MIGRATE:
             /**
              * ROUTE :
              *
              * @name migrate
              * @method POST
              * @format {:controller=>"disks", :action=>"migrate"}
              */
             if (is_null($this->_virtual_machine_id)) {
                 $this->logger->error('getResource( ' . $action . ' ): argument _virtual_machine_id not set.', __FILE__, __LINE__);
             } elseif (is_null($this->_id)) {
                 $this->logger->error('getResource( ' . $action . ' ): argument _id not set.', __FILE__, __LINE__);
             } else {
                 $resource = 'virtual_machines/' . $this->_virtual_machine_id . '/disks/' . $this->_id . '/migrate';
             }
             break;
         default:
             /**
              * ROUTE :
              *
              * @name disks
              * @method GET
              * @alias     /settings/disks(.:format)
              * @format    {:controller=>"disks", :action=>"index"}
              */
             /**
              * ROUTE :
              *
              * @name disk
              * @method GET
              * @alias     /settings/disks/:id(.:format)
              * @format    {:controller=>"disks", :action=>"show"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias     /settings/disks(.:format)
              * @format    {:controller=>"disks", :action=>"create"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method PUT
              * @alias  /settings/disks/:id(.:format)
              * @format {:controller=>"disks", :action=>"update"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method DELETE
              * @alias  /settings/disks/:id(.:format)
              * @format {:controller=>"disks", :action=>"destroy"}
              */
             $resource = parent::getResource($action);
             break;
     }
     $actions = array(ONAPP_GETRESOURCE_LIST, ONAPP_GETRESOURCE_ADD, ONAPP_GETRESOURCE_AUTOBACKUP_ENABLE, ONAPP_GETRESOURCE_AUTOBACKUP_DISABLE, ONAPP_GETRESOURCE_MIGRATE);
     if (in_array($action, $actions)) {
         $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     }
     return $resource;
 }
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              * @name virtual_machine_firewall_rules
              * @method GET
              * @alias     /virtual_machines/:virtual_machine_id/firewall_rules(.:format)
              * @format    {:controller=>"firewall_rules", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name virtual_machine_firewall_rule
              * @method GET
              * @alias     /virtual_machines/:virtual_machine_id/firewall_rules/:id(.:format)
              * @format    {:controller=>"firewall_rules", :action=>"show"}
              */
             /**
              * ROUTE :
              * @name
              * @method POST
              * @alias     /virtual_machines/:virtual_machine_id/firewall_rules(.:format)
              * @format    {:controller=>"firewall_rules", :action=>"create"}
              */
             /**
              * ROUTE :
              * @name
              * @method PUT
              * @alias  /virtual_machines/:virtual_machine_id/firewall_rules/:id(.:format)
              * @format {:controller=>"firewall_rules", :action=>"update"}
              */
             /**
              * ROUTE :
              * @name
              * @method DELETE
              * @alias     /virtual_machines/:virtual_machine_id/firewall_rules/:id(.:format)
              * @format    {:controller=>"firewall_rules", :action=>"destroy"}
              */
             $resource = 'virtual_machines/' . $this->_virtual_machine_id . '/' . $this->_resource;
             break;
         case ONAPP_GETRESOURCE_MOVE:
             /**
              * ROUTE :
              * @name move_virtual_machine_firewall_rule
              * @method GET
              * @alias     /virtual_machines/:virtual_machine_id/firewall_rules/:id/move(.:format)
              * @format    {:controller=>"firewall_rules", :action=>"move"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_DEFAULT) . '/' . $this->_id . '/move';
             break;
         case ONAPP_GETRESOURCE_UPDATE:
             /**
              * ROUTE :
              * @name update_firewall_rules_virtual_machine
              * @method POST
              * @alias     /virtual_machines/:id/update_firewall_rules(.:format)
              * @format    {:controller=>"virtual_machines", :action=>"update_firewall_rules"}
              */
             $resource = 'virtual_machines/' . $this->_virtual_machine_id . '/update_firewall_rules';
             break;
         case ONAPP_GETRESOURCE_UPDATE_DEFAULTS:
             /**
              * ROUTE :
              * @name update_firewall_rules_virtual_machine
              * @method POST
              * @alias   /virtual_machines/:id/update_firewall_rules(.:format)
              * @format  {:controller=>"virtual_machines", :action=>"update_firewall_rules"}
              */
             $resource = '/virtual_machines/' . $this->_virtual_machine_id . '/firewall_rules/update_defaults';
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 23
0
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_NETWORKS_LIST_BY_GROUP_ID:
             /**
              * ROUTE :
              *
              * @name user_group_users
              * @method GET
              * @alias   /user_groups/:user_group_id/users(.:format)
              * @format  {:controller=>"users", :action=>"index"}
              */
             $resource = 'user_groups/' . $this->_user_group_id . '/' . $this->_resource;
             break;
         case ONAPP_GETRESOURCE_SUSPEND_USER:
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/suspend';
             break;
         case ONAPP_GETRESOURCE_DELETE_USER:
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD);
             break;
         case ONAPP_GETRESOURCE_ACTIVATE:
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/activate';
             break;
         case ONAPP_GETRESOURCE_MAKE_NEW_API_KEY_USER:
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/make_new_api_key';
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     $actions = array(ONAPP_GETRESOURCE_SUSPEND_USER, ONAPP_GETRESOURCE_ACTIVATE, ONAPP_GETRESOURCE_MAKE_NEW_API_KEY_USER);
     if (in_array($action, $actions)) {
         $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     }
     return $resource;
 }
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              * @name    /users/:user_id/payments(.:format)
              * @method GET
              * @alias   /virtual_machines(.:format)
              * @format  {:controller=>"payments", :action=>"index"}
              */
             /**
              * ROUTE :
              * @name user_payment
              * @method GET
              * @alias    /users/:user_id/payments/:id(.:format)
              * @format   {:controller=>"payments", :action=>"show"}
              */
             /**
              * ROUTE :
              * @name
              * @method POST
              * @alias   /users/:user_id/payments(.:format)
              * @format  {:controller=>"payments", :action=>"create"}
              */
             /**
              * ROUTE :
              * @name
              * @method PUT
              * @alias   /users/:user_id/payments/:id(.:format)
              * @format  {:controller=>"payments", :action=>"update"}
              */
             /**
              * ROUTE :
              * @name
              * @method DELETE
              * @alias   /users/:user_id/payments/:id(.:format)
              * @format  {:controller=>"payments", :action=>"destroy"}
              */
             $resource = 'users/' . $this->_user_id . '/' . $this->_resource;
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 25
0
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DATASTORES_LIST_BY_HYPERVISOR_GROUP_ID:
             /**
              * ROUTE :
              *
              * @name hypervisor_group_data_stores
              * @method GET
              * @alias  /settings/hypervisor_zones/:hypervisor_group_id/data_stores(.:format)
              * @format {:action=>"index", :controller=>"data_stores"}
              */
             $resource = 'settings/hypervisor_zones/' . $this->_hypervisor_group_id . '/data_stores';
             break;
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              *
              * @name data_stores
              * @method GET
              * @alias  /settings/data_stores(.:format)
              * @format {:controller=>"data_stores", :action=>"index"}
              */
             /**
              * ROUTE :
              *
              * @name data_store
              * @method GET
              * @alias  /settings/data_stores/:id(.:format)
              * @format {:controller=>"data_stores", :action=>"show"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias   /settings/data_stores(.:format)
              * @format  {:controller=>"data_stores", :action=>"create"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method PUT
              * @alias  /settings/data_stores/:id(.:format)
              * @format {:controller=>"data_stores", :action=>"update"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method DELETE
              * @alias  /settings/data_stores/:id(.:format)
              * @format {:controller=>"data_stores", :action=>"destroy"}
              */
             return parent::getResource($action);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     return parent::getResource($action);
     /**
      * ROUTE :
      * @name transactions
      * @method GET
      * @alias   /settings/nameservers(.:format)
      * @format  {:controller=>"transactions", :action=>"index"}
      */
     /**
      * ROUTE :
      * @name transaction
      * @method GET
      * @alias    /transactions/:id(.:format)
      * @format   {:controller=>"transactions", :action=>"show"}
      */
 }
Ejemplo n.º 27
0
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @param string $action action name
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
             /**
              * ROUTE :
              *
              * @name user_user_white_lists
              * @method GET
              * @alias   /users/:user_id/user_white_lists(.:format)
              * @format  {:controller=>"user_white_lists", :action=>"index"}
              */
             /**
              * ROUTE :
              *
              * @name user_user_white_list
              * @method GET
              * @alias  /users/:user_id/user_white_lists/:id(.:format)
              * @format {:controller=>"user_white_lists", :action=>"show"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method PUT
              * @alias  /users/:user_id/user_white_lists/:id(.:format)
              * @format {:controller=>"user_white_lists", :action=>"update"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias  /users/:user_id/user_white_lists(.:format)
              * @format {:controller=>"user_white_lists", :action=>"create"}
              */
             /**
              * ROUTE :
              *
              * @name user_vm_stats
              * @method DELETE
              * @alias   /users/:user_id/user_white_lists/:id(.:format)
              * @format  {:controller=>"user_white_lists", :action=>"destroy"}
              */
             if (is_null($this->_user_id) && is_null($this->_obj->_user_id)) {
                 $this->logger->error("getResource({$action}): argument _user_id not set.", __FILE__, __LINE__);
             } else {
                 if (is_null($this->_user_id)) {
                     $this->_user_id = $this->_obj->_user_id;
                 }
             }
             $resource = 'users/' . $this->_user_id . '/' . $this->_resource;
             $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     return $resource;
 }
Ejemplo n.º 28
0
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_GETLIST_USERS:
             /**
              * ROUTE :
              *
              * @name billing_plan_users
              * @method GET
              * @alias  /billing_plans/:billing_plan_id/users(.:format)
              * @format {:controller=>"users", :action=>"index"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/users';
             break;
         case ONAPP_GETRESOURCE_CREATE_COPY:
             /**
              * ROUTE :
              *
              * @name create_copy_billing_plan
              * @method POST
              * @alias  /billing_plans/:id/create_copy(.:format)
              * @format {:controller=>"internationalization", :action=>"show"}
              */
             $resource = $this->getResource(ONAPP_GETRESOURCE_LOAD) . '/create_copy';
             break;
         default:
             /**
              * ROUTE :
              *
              * @name billing_plans
              * @method GET
              * @alias  /billing_plans(.:format)
              * @format {:controller=>"billing_plans", :action=>"index"}
              */
             /**
              * ROUTE :
              *
              * @name billing_plan
              * @method GET
              * @alias  /billing_plans/:id(.:format)
              * @format {:controller=>"billing_plans", :action=>"show"}
              */
             /**
              * ROUTE :
              *
              * @name billing_plans
              * @method POST
              * @alias  /billing_plans(.:format)
              * @format {:controller=>"billing_plans", :action=>"create"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method PUT
              * @alias  /billing_plans/:id(.:format)
              * @format {:controller=>"billing_plans", :action=>"update"}
              */
             /**
              * ROUTE :
              *
              * @name
              * @method DELETE
              * @alias  billing_plans/:id(.:format)
              * @format {:controller=>"billing_plans", :action=>"destroy"}
              */
             $resource = parent::getResource($action);
     }
     return $resource;
 }
Ejemplo n.º 29
0
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_ENABLE_CDN:
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias  /cdn_resources/enable(.:format)
              * @format {:controller=>"cdn_resources", :action=>"enable"}
              */
             $resource = $this->_resource . '/enable';
             break;
         case ONAPP_GETRESOURCE_CDN_PREFETCH:
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias  /cdn_resources/:id/prefetch(.:format)
              * @format {:controller=>"cdn_resources", :action=>"prefetch"}
              */
             $resource = $this->_resource . '/' . $this->_id . '/prefetch';
             break;
         case ONAPP_GETRESOURCE_CDN_PURGE:
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias  /cdn_resources/:id/purge(.:format)
              * @format {:controller=>"cdn_resources", :action=>"purge"}
              */
             $resource = $this->_resource . '/' . $this->_id . '/purge';
             break;
         case ONAPP_POSTRESOURCE_PURGE_ALL:
             /**
              * ROUTE :
              *
              * @name
              * @method POST
              * @alias  /cdn_resources/:id/purge_all(.:format)
              * @format {:controller=>"cdn_resources", :action=>"purge_all"}
              */
             $resource = $this->_resource . '/' . $this->_id . '/purge_all';
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     return $resource;
 }
Ejemplo n.º 30
0
 /**
  * Returns the URL Alias of the API Class that inherits the OnApp class
  *
  * @return string API resource
  * @access public
  */
 function getResource($action = ONAPP_GETRESOURCE_DEFAULT)
 {
     switch ($action) {
         case ONAPP_GETRESOURCE_DEFAULT:
         case ONAPP_GETRESOURCE_EDIT:
             /**
              * ROUTE :
              *
              * @name user_resource_limit
              * @method GET
              * @alias   /users/:user_id/resource_limit(.:format)
              * @format  {:controller=>"resource_limits", :action=>"show"}
              */
             /**
              * ROUTE :
              *
              * @name user_resource_limit
              * @method GET
              * @alias   /users/:user_id/resource_limit(.:format)
              * @format  {:controller=>"resource_limits", :action=>"update"}
              */
             if (is_null($this->_user_id) && is_null($this->_obj->_user_id)) {
                 $this->logger->error("getResource({$action}): argument _user_id not set.", __FILE__, __LINE__);
             } else {
                 if (is_null($this->_user_id)) {
                     $this->_user_id = $this->_obj->_user_id;
                 }
             }
             $resource = 'users/' . $this->_user_id . '/' . $this->_resource;
             break;
         case ONAPP_GETRESOURCE_LOAD:
             $resource = $this->getResource();
             break;
         default:
             $resource = parent::getResource($action);
             break;
     }
     $actions = array(ONAPP_GETRESOURCE_DEFAULT, ONAPP_GETRESOURCE_LOAD, ONAPP_GETRESOURCE_EDIT);
     if (in_array($action, $actions)) {
         $this->logger->debug('getResource( ' . $action . ' ): return ' . $resource);
     }
     return $resource;
 }