Sha256: 9ac3247f767d836fe0122aaab07d2e6b158eeb558aa9a8008ba00d5c9d83c6fe

Contents?: true

Size: 1.42 KB

Versions: 24

Compression:

Stored size: 1.42 KB

Contents

module Fog
  module AWS
    class Elasticache
      class Real

        require 'fog/aws/parsers/elasticache/single_cache_cluster'

        # Reboots some or all of an existing cache cluster's nodes
        # Returns a cache cluster description
        #
        # === Required Parameters
        # * id <~String> - The ID of the existing cluster to be rebooted
        # === Optional Parameters
        # * nodes_to_reboot <~Array> - Array of node IDs to reboot
        # === Returns
        # * response <~Excon::Response>:
        #   * body <~Hash>
        def reboot_cache_cluster(id, nodes_to_reboot)
          # Construct CacheNodeIdsToReboot parameters in the format:
          #   CacheNodeIdsToReboot.member.N => "node_id"
          node_ids = nodes_to_reboot || []
          node_id_params = node_ids.inject({}) do |node_hash, node_id|
            index = node_ids.index(node_id) + 1
            node_hash["CacheNodeIdsToReboot.member.#{index}"] = node_id
            node_hash
          end
          # Merge the CacheNodeIdsToReboot parameters with the normal options
          request(node_id_params.merge(
            'Action'          => 'RebootCacheCluster',
            'CacheClusterId'  => id,
            :parser => Fog::Parsers::AWS::Elasticache::SingleCacheCluster.new
          ))
        end

      end

      class Mock
        def reboot_cache_cluster
          Fog::Mock.not_implemented
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 7 rubygems

Version Path
fog-1.4.0 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
michiels-fog-1.3.1 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
fog-1.3.1 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
fog-1.3.0 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
fog-1.2.0 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
ktheory-fog-1.1.2 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
fog-1.1.2 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
fog_tractical-1.1.4 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
fog_tractical-1.1.3 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb
fog-1.1.1 lib/fog/aws/requests/elasticache/reboot_cache_cluster.rb