Module: Fog::Vcloud::Shared

Included in:
Mock, Real
Defined in:
lib/fog/vcloud.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#versions_uriObject (readonly)

Returns the value of attribute versions_uri.



41
42
43
# File 'lib/fog/vcloud.rb', line 41

def versions_uri
  @versions_uri
end

Instance Method Details

#default_organization_uriObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/fog/vcloud.rb', line 43

def default_organization_uri
  @default_organization_uri ||= begin
    unless @login_results
      
    end
    case @login_results.body[:Org]
    when Array
      @login_results.body[:Org].first[:href]
    when Hash
      @login_results.body[:Org][:href]
    else
      nil
    end
  end
end

#do_loginObject

login handles the auth, but we just need the Set-Cookie header from that call.



61
62
63
64
# File 'lib/fog/vcloud.rb', line 61

def 
  @login_results = 
  @cookie = @login_results.headers['Set-Cookie']
end

#ensure_unparsed(uri) ⇒ Object

private



78
79
80
81
82
83
84
# File 'lib/fog/vcloud.rb', line 78

def ensure_unparsed(uri)
  if uri.is_a?(String)
    uri
  else
    uri.to_s
  end
end

#supported_versionsObject



66
67
68
# File 'lib/fog/vcloud.rb', line 66

def supported_versions
  @supported_versions ||= get_versions(@versions_uri).body[:VersionInfo]
end

#xmlnsObject



70
71
72
73
74
# File 'lib/fog/vcloud.rb', line 70

def xmlns
  { "xmlns" => "http://www.vmware.com/vcloud/v0.8",
    "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
    "xmlns:xsd" => "http://www.w3.org/2001/XMLSchema" }
end