1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/lib/fog/aws/requests/kinesis/list_streams.rb
2015-07-02 12:02:39 -04:00

40 lines
1.2 KiB
Ruby

module Fog
module AWS
class Kinesis
class Real
# List availabe streams
#
# ==== Options
# * ExclusiveStartStreamName<~String>: The name of the stream to start the list with.
# * Limit<~Number>: The maximum number of streams to list.
# ==== Returns
# * response<~Excon::Response>:
#
# ==== See Also
# https://docs.aws.amazon.com/kinesis/latest/APIReference/API_ListStreams.html
#
def list_streams(options={})
response = request({
:idempotent => true,
'X-Amz-Target' => "Kinesis_#{@version}.ListStreams",
:body => {},
}.merge(options))
response.body = Fog::JSON.decode(response.body) unless response.body.nil?
response
end
end
class Mock
def list_streams(options={})
response = Excon::Response.new
response.status = 200
response.body = {
"HasMoreStreams" => false,
"StreamNames" => data[:kinesis_streams].map{ |stream| stream["StreamName"] }
}
response
end
end
end
end
end