mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
use std options={} format for optional parameters
This commit is contained in:
parent
1e92536eaf
commit
1153824067
2 changed files with 7 additions and 7 deletions
|
@ -3,13 +3,13 @@ module Fog
|
||||||
module Compute
|
module Compute
|
||||||
module VcloudDirector
|
module VcloudDirector
|
||||||
|
|
||||||
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/VmType.html
|
# @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/types/VAppType.html
|
||||||
class Vapp
|
class Vapp
|
||||||
attr_reader :name, :description
|
attr_reader :name, :options
|
||||||
|
|
||||||
def initialize(name, description=nil)
|
def initialize(name, options={})
|
||||||
@name = name
|
@name = name
|
||||||
@description = description
|
@options = options
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate_xml
|
def generate_xml
|
||||||
|
@ -18,7 +18,7 @@ module Fog
|
||||||
VApp('xmlns' => 'http://www.vmware.com/vcloud/v1.5',
|
VApp('xmlns' => 'http://www.vmware.com/vcloud/v1.5',
|
||||||
'name' => name
|
'name' => name
|
||||||
) {
|
) {
|
||||||
Description description unless description.nil?
|
Description options[:Description] if options.key?(:Description)
|
||||||
}
|
}
|
||||||
end.to_xml
|
end.to_xml
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,8 +19,8 @@ module Fog
|
||||||
#
|
#
|
||||||
# @see http://pubs.vmware.com/vcd-55/topic/com.vmware.vcloud.api.reference.doc_55/doc/operations/PUT-VAppNameAndDescription.html
|
# @see http://pubs.vmware.com/vcd-55/topic/com.vmware.vcloud.api.reference.doc_55/doc/operations/PUT-VAppNameAndDescription.html
|
||||||
# @since vCloud API version 0.9
|
# @since vCloud API version 0.9
|
||||||
def put_vapp_name_and_description(id, name, description=nil)
|
def put_vapp_name_and_description(id, name, options={})
|
||||||
body = Fog::Generators::Compute::VcloudDirector::Vapp.new(name, description).generate_xml
|
body = Fog::Generators::Compute::VcloudDirector::Vapp.new(name, options).generate_xml
|
||||||
request(
|
request(
|
||||||
:body => body,
|
:body => body,
|
||||||
:expects => 202,
|
:expects => 202,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue