diff --git a/c_bootstrap.go b/c_bootstrap.go index 10583a8..9cc019d 100644 --- a/c_bootstrap.go +++ b/c_bootstrap.go @@ -4,14 +4,18 @@ package main +import "strings" + // Bootstrap : .. type Bootstrap struct { } // Handle : .. func (n *Bootstrap) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "bootstrap.create.done", "bootstrap.create.error": + case "bootstrap.create": lines = n.getSingleDetail(components, "Bootstrap ran") } diff --git a/c_ebs_volume.go b/c_ebs_volume.go index 1aa3404..c12cebd 100644 --- a/c_ebs_volume.go +++ b/c_ebs_volume.go @@ -4,18 +4,22 @@ package main +import "strings" + // EBSVolume : ... type EBSVolume struct { } // Handle : ... func (n *EBSVolume) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "ebs_volume.create.done", "ebs_volume.create.error": + case "ebs_volume.create": lines = n.getSingleDetail(components, "Created EBS volume ") - case "ebs_volume.delete.done", "ebs_volume.delete.error": + case "ebs_volume.delete": lines = n.getSingleDetail(components, "Deleted EBS volume ") - case "ebs_volume.find.done", "ebs_volume.find.error": + case "ebs_volume.find": lines = n.getSingleDetail(components, "Found EBS volume ") } return lines diff --git a/c_elb.go b/c_elb.go index b166732..071160b 100644 --- a/c_elb.go +++ b/c_elb.go @@ -4,20 +4,24 @@ package main +import "strings" + // ELB : ... type ELB struct { } // Handle : ... func (n *ELB) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "elb.create.done", "elb.create.error": + case "elb.create": lines = n.getSingleDetail(components, "Created ELB") - case "elb.update.done", "elb.update.error": + case "elb.update": lines = n.getSingleDetail(components, "Updated ELB") - case "elb.delete.done", "elb.delete.error": + case "elb.delete": lines = n.getSingleDetail(components, "Deleted ELB") - case "elb.find.done", "elb.find.error": + case "elb.find": lines = n.getSingleDetail(components, "Found ELB") } diff --git a/c_execution.go b/c_execution.go index 5d25f67..8a4995d 100644 --- a/c_execution.go +++ b/c_execution.go @@ -4,14 +4,18 @@ package main +import "strings" + // Execution : ... type Execution struct { } // Handle : ... func (n *Execution) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "execution.create.done", "execution.create.error": + case "execution.create": lines = n.getSingleDetail(components, "Ran execution") } return lines diff --git a/c_firewall.go b/c_firewall.go index badbeca..27d4e81 100644 --- a/c_firewall.go +++ b/c_firewall.go @@ -4,20 +4,24 @@ package main +import "strings" + // Firewall : ... type Firewall struct { } // Handle : ... func (n *Firewall) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "firewall.create.done", "firewall.create.error": + case "firewall.create": lines = n.getSingleDetail(components, "Firewall created") - case "firewall.update.done", "firewall.update.error": + case "firewall.update": lines = n.getSingleDetail(components, "Firewall updated") - case "firewall.delete.done", "firewall.delete.error": + case "firewall.delete": lines = n.getSingleDetail(components, "Firewall deleted") - case "firewall.find.done", "firewall.find.error": + case "firewall.find": lines = n.getSingleDetail(components, "Firewall found") } return lines diff --git a/c_instance.go b/c_instance.go index 8f3a699..9d292da 100644 --- a/c_instance.go +++ b/c_instance.go @@ -4,20 +4,24 @@ package main +import "strings" + // Instance : ... type Instance struct { } // Handle : ... func (n *Instance) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "instance.create.done", "instance.create.error": + case "instance.create": lines = n.getSingleDetail(components, "Instance created") - case "instance.update.done", "instance.update.error": + case "instance.update": lines = n.getSingleDetail(components, "Instance udpated") - case "instance.delete.done", "instance.delete.error": + case "instance.delete": lines = n.getSingleDetail(components, "Instance delete") - case "instance.find.done", "instance.find.error": + case "instance.find": lines = n.getSingleDetail(components, "Instance find") } return lines diff --git a/c_nat.go b/c_nat.go index 15608be..4554378 100644 --- a/c_nat.go +++ b/c_nat.go @@ -4,20 +4,24 @@ package main +import "strings" + // Nat : ... type Nat struct { } // Handle : ... func (n *Nat) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "nat.create.done", "nat.create.error": + case "nat.create": lines = n.getSingleDetail(components, "Nat created") - case "nat.update.done", "nat.update.error": + case "nat.update": lines = n.getSingleDetail(components, "Nat updated") - case "nat.delete.done", "nat.delete.error": + case "nat.delete": lines = n.getSingleDetail(components, "Nat deleted") - case "nat.find.done", "nat.find.error": + case "nat.find": lines = n.getSingleDetail(components, "Nat created") } return lines diff --git a/c_network.go b/c_network.go index a3bdd83..6915ef1 100644 --- a/c_network.go +++ b/c_network.go @@ -4,18 +4,22 @@ package main +import "strings" + // Network : ... type Network struct { } // Handle : ... func (n *Network) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "network.create.done", "network.create.error": + case "network.create": lines = n.getSingleDetail(components, "Network created") - case "network.delete.done", "network.delete.error": + case "network.delete": lines = n.getSingleDetail(components, "Network deleted") - case "network.find.done", "network.find.error": + case "network.find": lines = n.getSingleDetail(components, "Network found") } return lines diff --git a/c_rds_cluster.go b/c_rds_cluster.go index cca46c0..39a3612 100644 --- a/c_rds_cluster.go +++ b/c_rds_cluster.go @@ -4,20 +4,24 @@ package main +import "strings" + // RDSCluster : ... type RDSCluster struct { } // Handle : ... func (n *RDSCluster) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "rds_cluster.create.done", "rds_cluster.create.error": + case "rds_cluster.create": lines = n.getSingleDetail(components, "RDS cluster created") - case "rds_cluster.update.done", "rds_cluster.update.error": + case "rds_cluster.update": lines = n.getSingleDetail(components, "RDS cluster updated") - case "rds_cluster.delete.done", "rds_cluster.delete.error": + case "rds_cluster.delete": lines = n.getSingleDetail(components, "RDS cluster deleted") - case "rds_cluster.find.done", "rds_cluster.find.error": + case "rds_cluster.find": lines = n.getSingleDetail(components, "RDS cluster found") } return lines diff --git a/c_rds_instance.go b/c_rds_instance.go index 55a7faf..6b65395 100644 --- a/c_rds_instance.go +++ b/c_rds_instance.go @@ -4,20 +4,24 @@ package main +import "strings" + // RDSInstance : ... type RDSInstance struct { } // Handle : ... func (n *RDSInstance) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "rds_instance.create.done", "rds_instance.create.error": + case "rds_instance.create": lines = n.getSingleDetail(components, "RDS instance created") - case "rds_instance.udpate.done", "rds_instance.update.error": + case "rds_instance.udpate": lines = n.getSingleDetail(components, "RDS instance updated") - case "rds_instance.delete.done", "rds_instance.delete.error": + case "rds_instance.delete": lines = n.getSingleDetail(components, "RDS instance deleted") - case "rds_instance.find.done", "rds_instance.find.error": + case "rds_instance.find": lines = n.getSingleDetail(components, "RDS instance found") } return lines diff --git a/c_router.go b/c_router.go index cad7f48..d2b65aa 100644 --- a/c_router.go +++ b/c_router.go @@ -4,17 +4,21 @@ package main +import "strings" + // Router : ... type Router struct { } // Handle : ... func (n *Router) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "router.create.done", "router.create.error": + case "router.create": lines = n.getSingleDetail(components, "Created router") - case "router.delete.done", "router.delete.error": + case "router.delete": lines = n.getSingleDetail(components, "Deleted router") } return lines diff --git a/c_s3.go b/c_s3.go index 035bf16..04302f6 100644 --- a/c_s3.go +++ b/c_s3.go @@ -4,20 +4,24 @@ package main +import "strings" + // S3Bucket : ... type S3Bucket struct { } // Handle : ... func (n *S3Bucket) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "s3.create.done", "s3.create.error": + case "s3.create": lines = n.getSingleDetail(components, "S3 bucket created") - case "s3.update.done", "s3.update.error": + case "s3.update": lines = n.getSingleDetail(components, "S3 bucket updated") - case "s3.delete.done", "s3.delete.error": + case "s3.delete": lines = n.getSingleDetail(components, "S3 bucket deleted") - case "s3.find.done", "s3.find.error": + case "s3.find": lines = n.getSingleDetail(components, "S3 bucket imported") } return lines diff --git a/c_vpc.go b/c_vpc.go index a2b7326..11415b6 100644 --- a/c_vpc.go +++ b/c_vpc.go @@ -4,20 +4,24 @@ package main +import "strings" + // Vpc : ... type Vpc struct { } // Handle : ... func (n *Vpc) Handle(subject string, components []interface{}, lines []Message) []Message { + parts := strings.Split(subject, ".") + subject = parts[0] + "." + parts[1] switch subject { - case "vpc.create.done", "vpc.create.error": + case "vpc.create": lines = n.getSingleDetail(components, "VPC created") - case "vpc.update.done", "vpc.update.error": + case "vpc.update": lines = n.getSingleDetail(components, "VPC udpated") - case "vpc.delete.done", "vpc.delete.error": + case "vpc.delete": lines = n.getSingleDetail(components, "VPC deleted") - case "vpc.find.done", "vpc.find.error": + case "vpc.find": lines = n.getSingleDetail(components, "VPC Found") } return lines