mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
SNS CreateTopic and DeleteTopic
This commit is contained in:
parent
2870fdea56
commit
e92ca191d7
5 changed files with 102 additions and 0 deletions
24
lib/fog/aws/parsers/sns/create_topic.rb
Normal file
24
lib/fog/aws/parsers/sns/create_topic.rb
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
module Fog
|
||||||
|
module Parsers
|
||||||
|
module AWS
|
||||||
|
module SNS
|
||||||
|
|
||||||
|
class CreateTopic < Fog::Parsers::Base
|
||||||
|
|
||||||
|
def reset
|
||||||
|
@response = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
def end_element(name)
|
||||||
|
case name
|
||||||
|
when 'TopicArn', 'RequestId'
|
||||||
|
@response[name] = @value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
24
lib/fog/aws/parsers/sns/delete_topic.rb
Normal file
24
lib/fog/aws/parsers/sns/delete_topic.rb
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
module Fog
|
||||||
|
module Parsers
|
||||||
|
module AWS
|
||||||
|
module SNS
|
||||||
|
|
||||||
|
class DeleteTopic < Fog::Parsers::Base
|
||||||
|
|
||||||
|
def reset
|
||||||
|
@response = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
def end_element(name)
|
||||||
|
case name
|
||||||
|
when 'RequestId'
|
||||||
|
@response[name] = @value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
26
lib/fog/aws/requests/sns/create_topic.rb
Normal file
26
lib/fog/aws/requests/sns/create_topic.rb
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
module Fog
|
||||||
|
module AWS
|
||||||
|
class SNS
|
||||||
|
class Real
|
||||||
|
|
||||||
|
require 'fog/aws/parsers/sns/create_topic'
|
||||||
|
|
||||||
|
def create_topic(options = {})
|
||||||
|
request({
|
||||||
|
'Action' => 'CreateTopic',
|
||||||
|
:parser => Fog::Parsers::AWS::SNS::CreateTopic.new
|
||||||
|
}.merge!(options))
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Mock
|
||||||
|
|
||||||
|
def create_topic(options = {})
|
||||||
|
Fog::Mock.not_implemented
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
26
lib/fog/aws/requests/sns/delete_topic.rb
Normal file
26
lib/fog/aws/requests/sns/delete_topic.rb
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
module Fog
|
||||||
|
module AWS
|
||||||
|
class SNS
|
||||||
|
class Real
|
||||||
|
|
||||||
|
require 'fog/aws/parsers/sns/delete_topic'
|
||||||
|
|
||||||
|
def delete_topic(options = {})
|
||||||
|
request({
|
||||||
|
'Action' => 'DeleteTopic',
|
||||||
|
:parser => Fog::Parsers::AWS::SNS::DeleteTopic.new
|
||||||
|
}.merge!(options))
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Mock
|
||||||
|
|
||||||
|
def delete_topic(options = {})
|
||||||
|
Fog::Mock.not_implemented
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -6,6 +6,8 @@ module Fog
|
||||||
recognizes :host, :path, :port, :scheme, :persistent
|
recognizes :host, :path, :port, :scheme, :persistent
|
||||||
|
|
||||||
request_path 'fog/aws/requests/sns'
|
request_path 'fog/aws/requests/sns'
|
||||||
|
request :create_topic
|
||||||
|
request :delete_topic
|
||||||
request :get_topic_attributes
|
request :get_topic_attributes
|
||||||
request :list_subscriptions
|
request :list_subscriptions
|
||||||
request :list_subscriptions_by_topic
|
request :list_subscriptions_by_topic
|
||||||
|
|
Loading…
Add table
Reference in a new issue