2015-06-19 16:55:32 -04:00
|
|
|
module Fog
|
|
|
|
module AWS
|
|
|
|
class Kinesis
|
|
|
|
class Real
|
|
|
|
# Deletes a stream and all its shards and data.
|
|
|
|
#
|
|
|
|
# ==== Options
|
|
|
|
# * StreamName<~String>: A name to identify the stream.
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
|
|
|
#
|
|
|
|
# ==== See Also
|
|
|
|
# https://docs.aws.amazon.com/kinesis/latest/APIReference/API_DeleteStream.html
|
|
|
|
#
|
|
|
|
def delete_stream(options={})
|
|
|
|
body = {
|
|
|
|
"StreamName" => options.delete("StreamName")
|
|
|
|
}.reject{ |_,v| v.nil? }
|
|
|
|
|
2015-07-02 15:59:39 -04:00
|
|
|
request({
|
|
|
|
'X-Amz-Target' => "Kinesis_#{@version}.DeleteStream",
|
|
|
|
:body => body,
|
|
|
|
}.merge(options))
|
2015-06-19 16:55:32 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
2015-06-30 18:15:14 -04:00
|
|
|
def delete_stream(options={})
|
|
|
|
stream_name = options.delete("StreamName")
|
|
|
|
|
|
|
|
unless stream = data[:kinesis_streams].detect{ |s| s["StreamName"] == stream_name }
|
2015-07-02 18:08:27 -04:00
|
|
|
raise Fog::AWS::Kinesis::ResourceNotFound.new("Stream #{stream_name} under account #{@account_id} not found.")
|
2015-06-30 18:15:14 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
data[:kinesis_streams].delete(stream)
|
|
|
|
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 200
|
|
|
|
response.body = ""
|
|
|
|
response
|
2015-06-19 16:55:32 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|