Method: Fog::AWS::RDS::Mock#describe_db_subnet_groups

Defined in:
lib/fog/aws/requests/rds/describe_db_subnet_groups.rb

#describe_db_subnet_groups(name = nil, opts = {}) ⇒ Object


38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/fog/aws/requests/rds/describe_db_subnet_groups.rb', line 38

def describe_db_subnet_groups(name = nil, opts = {})
  response = Excon::Response.new

  subnet_group_set = []
  if name
    if subnet_group = self.data[:subnet_groups][name]
      subnet_group_set << subnet_group
    else
      raise Fog::AWS::RDS::NotFound.new("Subnet Group #{name} not found")
    end
  else
    subnet_group_set = self.data[:subnet_groups].values
  end

  response.status = 200
  response.body = {
    "ResponseMetadata"=>{ "RequestId"=> Fog::AWS::Mock.request_id },
    "DescribeDBSubnetGroupsResult" => { "DBSubnetGroups" => subnet_group_set }
  }
  response
end