Method: Fog::Compute::AWS::Real#initialize
- Defined in:
- lib/fog/aws/compute.rb
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/fog/aws/compute.rb', line 314 def initialize(={}) require 'fog/core/parser' @use_iam_profile = [:use_iam_profile] setup_credentials() @connection_options = [:connection_options] || {} @region = [:region] ||= 'us-east-1' @instrumentor = [:instrumentor] @instrumentor_name = [:instrumentor_name] || 'fog.aws.compute' @version = [:version] || '2012-07-20' if @endpoint = [:endpoint] endpoint = URI.parse(@endpoint) @host = endpoint.host @path = endpoint.path @port = endpoint.port @scheme = endpoint.scheme else @host = [:host] || "ec2.#{[:region]}.amazonaws.com" @path = [:path] || '/' @persistent = [:persistent] || false @port = [:port] || 443 @scheme = [:scheme] || 'https' end @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options) end |