1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #2653 from josephholsten/config_drive_rs

add config_disk attribute to rackspace compute_v2 server
This commit is contained in:
Kyle Rames 2014-02-18 08:02:49 -06:00
commit ff9b20c8bc
3 changed files with 16 additions and 1 deletions

View file

@ -480,6 +480,11 @@ The `create` method also supports the following key values:
<td>:personality</td>
<td>Array of files to be injected onto the server. Please refer to the Fog <a href="http://rubydoc.info/github/fog/fog/Fog/Compute/RackspaceV2/Server:personality">personality </a> API documentation for further information.</td>
</tr>
<tr>
<td>:config_drive</td>
<td>Whether a read-only configuration drive is attached. Refer to Next Gen Server API documentation - <a
href="http://docs.rackspace.com/servers/api/v2/cs-devguide/content/config_drive_ext.html">Config Drive Extension</a>.</td>
</tr>
</table>
## Bootstrap

View file

@ -111,6 +111,12 @@ module Fog
# and so on, and enables you to manage the disk configuration.
attribute :disk_config, :aliases => 'OS-DCF:diskConfig'
# @!attribute [rw] config_drive_ext
# @return [Boolean] whether a read-only configuration drive is attached
# @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/config_drive_ext.html
attribute :config_drive
# @!attribute [r] bandwidth
# @return [Array] The amount of bandwidth used for the specified audit period.
# @see http://docs.rackspace.com/servers/api/v2/cs-devguide/content/ch_extensions.html#bandwidth_extension
@ -211,7 +217,7 @@ module Fog
# Creates server
# * requires attributes: service:, :name, :image_id, and :flavor_id
# * optional attributes :disk_config, :metadata, :personality
# * optional attributes :disk_config, :metadata, :personality, :config_drive
# @return [Boolean] returns true if server is being created
# @raise [Fog::Compute::RackspaceV2::NotFound] - HTTP 404
# @raise [Fog::Compute::RackspaceV2::BadRequest] - HTTP 400
@ -237,6 +243,7 @@ module Fog
modified_options[:disk_config] = disk_config unless disk_config.nil?
modified_options[:metadata] = metadata.to_hash unless @metadata.nil?
modified_options[:personality] = personality unless personality.nil?
modified_options[:config_drive] = config_drive unless config_drive.nil?
modified_options[:key_name] ||= attributes[:key_name]
if modified_options[:networks]

View file

@ -12,6 +12,7 @@ module Fog
# @option options [Hash] metadata key value pairs of server metadata
# @option options [String] OS-DCF:diskConfig The disk configuration value. (AUTO or MANUAL)
# @option options [Hash] personality Hash containing data to inject into the file system of the cloud server instance during server creation.
# @option options [Boolean] config_drive whether to attach a read-only configuration drive
# @option options [String] keypair Name of the kay-pair to associate with this server.
# @return [Excon::Response] response:
# * body [Hash]:
@ -55,6 +56,8 @@ module Fog
data['server']['OS-DCF:diskConfig'] = options[:disk_config] unless options[:disk_config].nil?
data['server']['metadata'] = options[:metadata] unless options[:metadata].nil?
data['server']['personality'] = options[:personality] unless options[:personality].nil?
data['server']['config_drive'] = options[:config_drive] unless
options[:config_drive].nil?
data['server']['networks'] = options[:networks] || [
{ :uuid => '00000000-0000-0000-0000-000000000000' },
{ :uuid => '11111111-1111-1111-1111-111111111111' }