Sha256: 98c68743cc91f75604cf4dc3e083bdba46badfe96b1dc9c4eb2e4c88d9a49650

Contents?: true

Size: 692 Bytes

Versions: 1

Compression:

Stored size: 692 Bytes

Contents

require 'ace-client'

module Ncf
	class Client < AceClient::Query2
		class ResponseError < StandardError; end

		def initialize(options)
			super(options)
		end

		def execute_stack(json)
			@response = self.action('ExecuteStack', 'TemplateBody' => json)
			raise_if_response_error
			@response
		end

		def describe_stack(exec_id)
			@response = self.action('DescribeStack', 'ExecutionId' => exec_id)
			raise_if_response_error
			@response
		end

		def raise_if_response_error
			if @response.code != 200
				code = @response['ErrorResponse']['Error']['Code']
				message = @response['ErrorResponse']['Error']['Message']
				raise ResponseError, "#{code}: #{message}"
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ncf-0.0.2 lib/ncf/client.rb