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.



34
35
36
# File 'lib/fog/vcloud.rb', line 34

def versions_uri
  @versions_uri
end

Instance Method Details

#default_organization_uriObject



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/fog/vcloud.rb', line 36

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.



54
55
56
57
# File 'lib/fog/vcloud.rb', line 54

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

#ensure_unparsed(uri) ⇒ Object

private



71
72
73
74
75
76
77
# File 'lib/fog/vcloud.rb', line 71

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

#supported_versionsObject



59
60
61
# File 'lib/fog/vcloud.rb', line 59

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

#xmlnsObject



63
64
65
66
67
# File 'lib/fog/vcloud.rb', line 63

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