Class: VCloudSdk::Xml::DiskCreateParams

Inherits:
Wrapper
  • Object
show all
Defined in:
lib/cloud/vcloud/xml/wrapper_classes/disk_create_params.rb

Instance Method Summary collapse

Methods inherited from Wrapper

#==, #[], #[]=, #add_child, #attribute_with_ns, #content, #content=, #create_child, #create_qualified_name, #create_xpath_query, #doc_namespaces, #error, #get_nodes, #href, #href_id, #initialize, #name, #to_s, #type, #urn, #xpath

Constructor Details

This class inherits a constructor from VCloudSdk::Xml::Wrapper

Instance Method Details

#add_locality(local) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk_create_params.rb', line 21

def add_locality(local)
  if !@local_exists.nil? && @local_exists
    raise "Cannot add locality more than once to DiskCreateParams"
  end
  @local_exists = true
  node = create_child("Locality")
  node["href"] = local.href
  # Bug in create independent disk API.  It needs the UUID part of the
  # ID instead of the entire ID like other REST API calls.
  node["id"] = extract_uuid(local.urn)
  node["type"] = MEDIA_TYPE[:VM]
  disk.node.after(node)
end

#bus_sub_type=(value) ⇒ Object



9
10
11
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk_create_params.rb', line 9

def bus_sub_type=(value)
  disk["busSubType"] = value.to_s
end

#bus_type=(value) ⇒ Object



5
6
7
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk_create_params.rb', line 5

def bus_type=(value)
  disk["busType"] = value.to_s
end

#name=(name) ⇒ Object



13
14
15
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk_create_params.rb', line 13

def name=(name)
  disk["name"] = name.to_s
end

#size_bytes=(value) ⇒ Object



17
18
19
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk_create_params.rb', line 17

def size_bytes=(value)
  disk["size"] = value.to_s
end

#storage_profile=(storage_profile) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/cloud/vcloud/xml/wrapper_classes/disk_create_params.rb', line 35

def storage_profile=(storage_profile)
  return unless storage_profile

  raise "disk storage profile already set." if @storage_profile
  @storage_profile = true

  node = create_child("StorageProfile")
  node["type"] = storage_profile.type
  node["name"] = storage_profile.name
  node["href"] = storage_profile.href
  disk.node.add_child(node)
end