Method: Fog::AWS::Elasticache::Mock#create_cache_nodes

Defined in:
lib/fog/aws/elasticache.rb

#create_cache_nodes(cluster_id, num_nodes = 1, port = '11211') ⇒ Object

returns an Array of (Mock) elasticache nodes, representated as Hashes



173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/fog/aws/elasticache.rb', line 173

def create_cache_nodes(cluster_id, num_nodes = 1, port = '11211')
  (1..num_nodes).map do |node_number|
    node_id = "%04d" % node_number
    { # each hash represents a cache cluster node
      "CacheNodeId"           => node_id,
      "Port"                  => port,
      "ParameterGroupStatus"  => "in-sync",
      "CacheNodeStatus"       => "available",
      "CacheNodeCreateTime"   => Time.now.utc.to_s,
      "Address" =>
        "#{cluster_id}.#{node_id}.use1.cache.amazonaws.com"
    }
  end
end