Class: OpenStack::Nova::Compute::Base
- Inherits:
-
Common
- Object
- ActiveResource::Base
- Base
- Common
- OpenStack::Nova::Compute::Base
- Defined in:
- lib/open_stack/nova/compute/base.rb
Direct Known Subclasses
BaseDetail, FloatingIp, FloatingIpPool, KeyPair, Network, QuotaSet, Rule, SecurityGroup, ServerUsage, SimpleTenantUsage, VolumeAttachment
Class Method Summary collapse
-
.site ⇒ Object
Get the Nova Compute endpoint assigned to OpenStack::Nova::Compute classes.
-
.site=(site) ⇒ Object
Set the Nova Compute endpoint for OpenStack::Nova::Compute classes.
Methods inherited from Common
collection_path, custom_method_collection_url, element_path
Methods inherited from Base
Methods inherited from ActiveResource::Base
Class Method Details
.site ⇒ Object
Get the Nova Compute endpoint assigned to OpenStack::Nova::Compute classes
27 28 29 30 31 32 33 |
# File 'lib/open_stack/nova/compute/base.rb', line 27 def self.site if self == OpenStack::Nova::Compute::Base Thread.current[:open_stack_nova_compute_site] else super end end |
.site=(site) ⇒ Object
Set the Nova Compute endpoint for OpenStack::Nova::Compute classes
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/open_stack/nova/compute/base.rb', line 36 def self.site=(site) super(site) Thread.current[:open_stack_nova_compute_site] = @site # Regenerate the prefix method default = @site.path default << '/' unless default[-1..-1] == '/' # generate the actual method based on the current site path self.prefix = default @site end |