Skip to content

Commit

Permalink
Add informational reporting for sql_firewall_rules
Browse files Browse the repository at this point in the history
  • Loading branch information
g3kk0 committed May 15, 2017
1 parent 993901a commit ac98f19
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions c_sql_firewall_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ func (n *SQLFirewallRule) Handle(subject string, c component, lines []Message) [
parts := strings.Split(subject, ".")
subject = parts[0] + "." + parts[1]
switch subject {
case "sql_server.create":
lines = n.getSingleDetail(c, "Created SQL Server")
case "sql_server.update":
lines = n.getSingleDetail(c, "Updated SQL Server")
case "sql_server.delete":
lines = n.getSingleDetail(c, "Deleted SQL Server")
case "sql_servers.find":
case "sql_firewall_rule.create":
lines = n.getSingleDetail(c, "Created SQL Firewall Rule")
case "sql_firewall_rule.update":
lines = n.getSingleDetail(c, "Updated SQL Firewall Rule")
case "sql_firewall_rule.delete":
lines = n.getSingleDetail(c, "Deleted SQL Firewall Rule")
case "sql_firewall_rule.find":
for _, cx := range c.getFoundComponents() {
lines = append(lines, n.getSingleDetail(cx, "Found SQL Server")...)
lines = append(lines, n.getSingleDetail(cx, "Found SQL Firewall Rule")...)
}
}
return lines
}

func (n *SQLServer) getSingleDetail(c component, prefix string) (lines []Message) {
func (n *SQLFirewallRule) getSingleDetail(c component, prefix string) (lines []Message) {
name, _ := c["name"].(string)
if prefix != "" {
name = prefix + " " + name
Expand Down

0 comments on commit ac98f19

Please sign in to comment.