Sha256: 1477645a3c636bbdca1dacc88765d44a4b18f7e5e94490219a19bf2e045e018b
Contents?: true
Size: 785 Bytes
Versions: 13
Compression:
Stored size: 785 Bytes
Contents
module Fog module Vsphere class Compute class Rules < Fog::Collection model Fog::Vsphere::Compute::Rule attribute :datacenter attribute :cluster def all(_filters = {}) requires :datacenter, :cluster load service.list_rules(datacenter: datacenter, cluster: cluster) end def get(key_or_name) all.find { |rule| [rule.key, rule.name].include? key_or_name } || raise(Fog::Vsphere::Compute::NotFound, "no such rule #{key_or_name}") end # Pass datacenter/cluster to every new rule def new(attributes = {}) requires :datacenter, :cluster super(attributes.merge(datacenter: datacenter, cluster: cluster)) end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems