mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[compute|aws] add modify_image_attribute
This commit is contained in:
parent
1708c475f8
commit
ea1de32943
2 changed files with 38 additions and 0 deletions
|
@ -71,6 +71,7 @@ module Fog
|
|||
request :get_password_data
|
||||
request :import_key_pair
|
||||
request :modify_image_attribute
|
||||
request :modify_instance_attribute
|
||||
request :modify_snapshot_attribute
|
||||
request :purchase_reserved_instances_offering
|
||||
request :reboot_instances
|
||||
|
|
37
lib/fog/compute/requests/aws/modify_instance_attribute.rb
Normal file
37
lib/fog/compute/requests/aws/modify_instance_attribute.rb
Normal file
|
@ -0,0 +1,37 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class AWS
|
||||
class Real
|
||||
|
||||
require 'fog/compute/parsers/aws/basic'
|
||||
|
||||
# Modify instance attributes
|
||||
#
|
||||
# ==== Parameters
|
||||
# * image_id<~String> - Id of machine image to modify
|
||||
# * attributes<~Hash>:
|
||||
# 'InstanceType.Value'<~String> - New instance type
|
||||
# 'Kernel.Value'<~String> - New kernel value
|
||||
# 'Ramdisk.Value'<~String> - New ramdisk value
|
||||
# 'UserData.Value'<~String> - New userdata value
|
||||
# 'DisableApiTermination.Value'<~Boolean> - Change api termination value
|
||||
# 'InstanceInitiatedShutdownBehavior.Value'<~String> - New instance initiated shutdown behaviour, in ['stop', 'terminate']
|
||||
# 'SourceDestCheck.Value'<~Boolean> - New sourcedestcheck value
|
||||
# 'GroupId'<~Array> - One or more groups to add instance to (VPC only)
|
||||
#
|
||||
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ModifyInstanceAttribute.html]
|
||||
#
|
||||
def modify_instance_attributes(image_id, attributes)
|
||||
params = {}
|
||||
params.merge!(Fog::AWS.indexed_param('GroupId', attributes['GroupId'] || []))
|
||||
request({
|
||||
'Action' => 'ModifyInstanceAttribute',
|
||||
:idempotent => true,
|
||||
:parser => Fog::Parsers::Compute::AWS::Basic.new
|
||||
}.merge!(params))
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue