Class: Fog::Compute::Aliyun::SecurityGroupRules

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/aliyun/models/compute/security_group_rules.rb

Instance Method Summary collapse

Instance Method Details

#get(security_group_id, options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/fog/aliyun/models/compute/security_group_rules.rb', line 13

def get(security_group_id, options = {})
  data = Fog::JSON.decode(service.list_security_group_rules(security_group_id, options).body)
  self.security_group_id = data['SecurityGroupId']
  permissions = data['Permissions']['Permission']
  permissions.each do |permission|
    permission['SecurityGroupId'] = self.security_group_id
  end
  load(permissions)
end