Sha256: dca13cf237f6f364d2c2520bfac407eb8ac863deb2396d88a0b4437d4ac41ea3
Contents?: true
Size: 1.72 KB
Versions: 12
Compression:
Stored size: 1.72 KB
Contents
module Fog module Compute class Cloudstack class SecurityGroup < Fog::Model identity :id, :aliases => 'id' attribute :name, :type => :string attribute :description, :type => :string attribute :account, :type => :string attribute :domain_id, :aliases => "domainid", :type => :string attribute :domain_name, :aliases => "domain", :type => :string attribute :project_id, :aliases => "projectid", :type => :string attribute :project_name, :aliases => "project", :type => :string attribute :ingress_rules, :aliases => "ingressrule", :type => :array attribute :egress_rules, :aliases => "egressrule", :type => :array def destroy requires :id connection.delete_security_group('id' => self.id) true end def egress_rules attributes[:egress_rules] || [] end def ingress_rules attributes[:ingress_rules] || [] end def save requires :name options = { 'name' => self.name, 'account' => self.account, 'description' => self.description, 'projectid' => self.project_id, 'domainid' => self.domain_id, } data = connection.create_security_group(options) merge_attributes(data['createsecuritygroupresponse']['securitygroup']) end def rules connection.security_group_rules.all("security_group_id" => self.id) end end # SecurityGroup end # Cloudstack end # Compute end # Fog
Version data entries
12 entries across 12 versions & 7 rubygems