Class: Misty::Openstack::Nova::V2_1

Inherits:
HTTP::Client show all
Extended by:
Misty::Openstack::NovaV2_1
Includes:
Microversion
Defined in:
lib/misty/openstack/nova/v2_1.rb

Constant Summary

Constants included from Microversion

Microversion::VERSION_STATES

Constants inherited from HTTP::Client

HTTP::Client::INTERFACES

Instance Attribute Summary

Attributes inherited from HTTP::Client

#microversion

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Misty::Openstack::NovaV2_1

v2_1

Methods included from Microversion

#initialize, #version_get, #versions

Methods inherited from HTTP::Client

#headers, #initialize, prefix_path_to_ignore, #requests

Methods included from HTTP::Direct

#base_set, #delete, #get, #post, #put

Methods included from HTTP::Request

#decode?, #http, #http_copy, #http_delete, #http_get, #http_head, #http_options, #http_patch, #http_post, #http_put, #http_to_s

Methods included from HTTP::MethodBuilder

#method_missing

Methods included from HTTP::NetHTTP

http_request

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Misty::HTTP::MethodBuilder

Class Method Details

.apiObject



12
13
14
# File 'lib/misty/openstack/nova/v2_1.rb', line 12

def self.api
  v2_1
end

.list_all_major_versionsObject

Overrides API because the definitions don’t specify prefix



17
18
19
# File 'lib/misty/openstack/nova/v2_1.rb', line 17

def self.list_all_major_versions
  http_get('/', headers)
end

.service_namesObject



25
26
27
# File 'lib/misty/openstack/nova/v2_1.rb', line 25

def self.service_names
    %w{compute}
end

.show_details_of_specific_api_version(version) ⇒ Object



21
22
23
# File 'lib/misty/openstack/nova/v2_1.rb', line 21

def self.show_details_of_specific_api_version(version)
  http_get("/#{version}", headers)
end

Instance Method Details

#microversion_headerObject



29
30
31
32
33
34
35
# File 'lib/misty/openstack/nova/v2_1.rb', line 29

def microversion_header
  # Versions 2.27+ use default OpenStack-API-Version
  header = super
  # For prior vesions then remove once depcrecated
  header.merge!('X-Openstack-Nova-API-Version' => "#{@version}",)
  header
end