Sha256: 581bac975a0a7431c0518850c399c90cf246425c99b6bac6e5dde0c46ff09bae
Contents?: true
Size: 1.47 KB
Versions: 68
Compression:
Stored size: 1.47 KB
Contents
module Fog module AWS class Kinesis class Real # Adds or updates tags for the specified Amazon Kinesis stream. # # ==== Options # * StreamName<~String>: The name of the stream. # * Tags<~Hash>: The set of key-value pairs to use to create the tags. # ==== Returns # * response<~Excon::Response>: # # ==== See Also # https://docs.aws.amazon.com/kinesis/latest/APIReference/API_AddTagsToStream.html # def add_tags_to_stream(options={}) body = { "StreamName" => options.delete("StreamName"), "Tags" => options.delete("Tags") }.reject{ |_,v| v.nil? } request({ 'X-Amz-Target' => "Kinesis_#{@version}.AddTagsToStream", :body => body, }.merge(options)) end end class Mock def add_tags_to_stream(options={}) stream_name = options.delete("StreamName") tags = options.delete("Tags") unless stream = data[:kinesis_streams].detect{ |s| s["StreamName"] == stream_name } raise Fog::AWS::Kinesis::ResourceNotFound.new("Stream #{stream_name} under account #{@account_id} not found.") end stream["Tags"] = stream["Tags"].merge(tags) response = Excon::Response.new response.status = 200 response.body = "" response end end end end end
Version data entries
68 entries across 66 versions & 3 rubygems