class Serverspec::Type::RabbitmqVhostPolicy
Public Class Methods
new(name = nil, vhost = nil, options = {})
click to toggle source
Calls superclass method
Serverspec::Type::RabbitmqBase::new
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 7 def initialize(name = nil, vhost = nil, options = {}) super(name, options) @vhost = vhost end
Public Instance Methods
apply_to?(arg)
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 64 def apply_to?(arg) inspection['apply-to'] == arg end
exist?()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 24 def exist? !inspection.nil? end
ha_mode()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 32 def ha_mode inspection['definition']['ha-mode'] end
ha_nodes()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 48 def ha_nodes inspection['definition']['ha-params'] end
ha_sync_mode()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 40 def ha_sync_mode inspection['definition']['ha-sync-mode'] end
has_ha_mode?(mode)
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 28 def has_ha_mode?(mode) inspection['definition']['ha-mode'] == mode end
has_ha_nodes?(count)
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 44 def has_ha_nodes?(count) inspection['definition']['ha-params'].to_i == count.to_i end
has_ha_sync_mode?(mode)
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 36 def has_ha_sync_mode?(mode) inspection['definition']['ha-sync-mode'] == mode end
inspection()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 12 def inspection @inspection ||= ::MultiJson.load(get_inspection.stdout).find { |itm| itm['name'] == @name } end
mirror_all?()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 52 def mirror_all? apply_to?('all') end
mirror_exchanges?()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 60 def mirror_exchanges? apply_to?('exchanges') end
mirror_queues?()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 56 def mirror_queues? apply_to?('queues') end
to_s()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 16 def to_s "RabbitMQ policy '#{@name}' on vhost '#{@vhost}'" end
url()
click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_vhost_policy.rb, line 20 def url "#{@url_base}/api/policies/#{@vhost}" end