本文整理汇总了PHP中OnApp::getResource方法的典型用法代码示例。如果您正苦于以下问题:PHP OnApp::getResource方法的具体用法?PHP OnApp::getResource怎么用?PHP OnApp::getResource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OnApp
的用法示例。
在下文中一共展示了OnApp::getResource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getResource
/**
* 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;
}
示例2: getResource
/**
* 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;
}
示例3: getResource
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"}
*/
}
示例4: getResource
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"}
*/
}
示例5: getResource
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;
}
示例6: getResource
/**
* 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;
}
示例7: getResource
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;
}
示例8: getResource
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;
}
示例9: getResource
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"}
*/
//.........这里部分代码省略.........
示例10: getResource
/**
* 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;
}
示例11: getResource
/**
* 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;
}
示例12: getResource
/**
* 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;
}
示例13: getResource
/**
* 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;
}
示例14: getResource
/**
* 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;
}
示例15: getResource
/**
* 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;
}