rubocop:enable LineLength, Metrics/MethodLength, Metrics/ClassLength, Metrics/AbcSize
# File lib/fog/shared_file_system/openstack.rb, line 319 def initialize(options = {}) @supported_versions = SUPPORTED_VERSIONS @supported_microversion = SUPPORTED_MICROVERSION @fixed_microversion = options[:openstack_shared_file_system_microversion] @microversion_key = 'X-Openstack-Manila-Api-Version'.freeze initialize_identity options @openstack_service_type = options[:openstack_service_type] || ['sharev2'] @openstack_service_name = options[:openstack_service_name] @connection_options = options[:connection_options] || {} authenticate set_api_path set_microversion @persistent = options[:persistent] || false @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) end
# File lib/fog/shared_file_system/openstack.rb, line 315 def self.not_found_class Fog::SharedFileSystem::OpenStack::NotFound end
# File lib/fog/shared_file_system/openstack.rb, line 348 def action_prefix microversion_newer_than?('2.6') ? '' : 'os-' end
# File lib/fog/shared_file_system/openstack/requests/create_snapshot.rb, line 5 def create_snapshot(share_id, options = {}) data = { 'share_id' => share_id } vanilla_options = [ :name, :description, :display_name, :display_description, :force ] vanilla_options.select { |o| options[o] }.each do |key| data[key] = options[key] end request( :body => Fog::JSON.encode('snapshot' => data), :expects => 202, :method => 'POST', :path => 'snapshots' ) end
# File lib/fog/shared_file_system/openstack/requests/delete_snapshot.rb, line 5 def delete_snapshot(id) request( :expects => 202, :method => 'DELETE', :path => "snapshots/#{id}" ) end
# File lib/fog/shared_file_system/openstack/requests/get_limits.rb, line 5 def get_limits request( :expects => 200, :method => 'GET', :path => 'limits' ) end
# File lib/fog/shared_file_system/openstack/requests/get_quota.rb, line 5 def get_quota(project_id) request( :expects => 200, :method => 'GET', :path => "#{action_prefix}quota-sets/#{project_id}" ) end
# File lib/fog/shared_file_system/openstack/requests/get_snapshot.rb, line 5 def get_snapshot(id) request( :expects => 200, :method => 'GET', :path => "snapshots/#{id}" ) end
# File lib/fog/shared_file_system/openstack/requests/list_availability_zones.rb, line 5 def list_availability_zones() request( :expects => 200, :method => 'GET', :path => microversion_newer_than?('2.6') ? 'availability-zones' : 'os-availability-zone' ) end
# File lib/fog/shared_file_system/openstack/requests/list_snapshots.rb, line 5 def list_snapshots(options = {}) request( :expects => 200, :method => 'GET', :path => 'snapshots', :query => options ) end
# File lib/fog/shared_file_system/openstack/requests/list_snapshots_detail.rb, line 5 def list_snapshots_detail(options = {}) request( :expects => 200, :method => 'GET', :path => 'snapshots/detail', :query => options ) end
# File lib/fog/shared_file_system/openstack.rb, line 339 def set_api_path unless @path.match(@supported_versions) @path = Fog::OpenStack.get_supported_version_path(@supported_versions, @openstack_management_uri, @auth_token, @connection_options) end end
# File lib/fog/shared_file_system/openstack/requests/update_quota.rb, line 5 def update_quota(project_id, options = {}) request( :body => Fog::JSON.encode('quota_set' => options), :expects => 200, :method => 'PUT', :path => "#{action_prefix}quota-sets/#{project_id}" ) end
# File lib/fog/shared_file_system/openstack/requests/update_snapshot.rb, line 5 def update_snapshot(id, options = {}) request( :body => Fog::JSON.encode('snapshot' => options), :expects => 200, :method => 'PUT', :path => "snapshots/#{id}" ) end