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/create_stream.rb
2015-07-02 12:02:38 -04:00

38 lines
1.1 KiB
Ruby

module Fog
module AWS
class Kinesis
class Real
# Creates a Amazon Kinesis stream.
#
# ==== Options
# * ShardCount<~Number>: The number of shards that the stream will use.
# * StreamName<~String>: A name to identify the stream.
# ==== Returns
# * response<~Excon::Response>:
#
# ==== See Also
# https://docs.aws.amazon.com/kinesis/latest/APIReference/API_CreateStream.html
#
def create_stream(options={})
body = {
"ShardCount" => options.delete("ShardCount") || 1,
"StreamName" => options.delete("StreamName")
}.reject{ |_,v| v.nil? }
response = request({
'X-Amz-Target' => 'Kinesis_20131202.CreateStream',
:body => body,
}.merge(options))
# response.body = Fog::JSON.decode(response.body) unless response.body.nil?
response
end
end
class Mock
def create_streams(options={})
raise Fog::Mock::NotImplementedError
end
end
end
end
end