func LoadAlarmClass(name string) (AlarmClass, error) {
	cfgs := make(AlarmClasses)
	item, err := GetItemByName("alarms", name)
	if err != nil {
		return cfgs[name], err
	}
	cfgs.Marshal([]*simpledb.Item{item})
	return cfgs[name], nil
}
LoadAlarmClass loads a single Alarm Class
package config
import (
	"encoding/json"
	"strconv"
	"strings"
	"github.com/aws/aws-sdk-go/service/simpledb"
)
type AlarmClasses map[string]AlarmClass
type AlarmClass struct {
	AlarmDescription        string   `json:"alarmDescription" awsmClass:"Alarm Description"`
	AlarmActions            []string `json:"alarmActions" awsmClass:"Alarm Actions"`
	OKActions               []string `json:"okActions" awsmClass:"OK Actions"`
	InsufficientDataActions []string `json:"insufficientDataActions" awsmClass:"Insufficient Data Actions"`
	MetricName              string   `json:"metricName" awsmClass:"Metric Name"`
	Namespace               string   `json:"namespace" awsmClass:"Namespace"`
	Statistic               string   `json:"statistic" awsmClass:"Statistic"`
	Period                  int      `json:"period" awsmClass:"Period"`
	EvaluationPeriods       int      `json:"evaluationPeriods" awsmClass:"Evaluation Periods"`
	Threshold               float64  `json:"threshold" awsmClass:"Threshold"`
	ComparisonOperator      string   `json:"comparisonOperator" awsmClass:"Comparison Operator"`
	ActionsEnabled          bool     `json:"actionsEnabled" awsmClass:"Actions Enabled"`
	Unit                    string   `json:"unit" awsmClass:"Unit"`
}
func DefaultAlarms() AlarmClasses {
	defaultAlarms := make(AlarmClasses)
	defaultAlarms["cpuHigh"] = AlarmClass{
		AlarmDescription:   "Scale-up based on CPU",
		AlarmActions:       []string{"scaleUp"},
		OKActions:          []string{},
		MetricName:         "CPUUtilization",
		Namespace:          "AWS/EC2",
		Statistic:          "Average",
		Period:             60,
		EvaluationPeriods:  2,
		Threshold:          60.0,
		ComparisonOperator: "GreaterThanThreshold",
		ActionsEnabled:     true,
	}
	defaultAlarms["cpuLow"] = AlarmClass{
		AlarmDescription:   "Scale-down based on CPU",
		AlarmActions:       []string{"scaleDown"},
		OKActions:          []string{},
		MetricName:         "CPUUtilization",
		Namespace:          "AWS/EC2",
		Statistic:          "Average",
		Period:             600,
		EvaluationPeriods:  2,
		Threshold:          20.0,
		ComparisonOperator: "LessThanThreshold",
		ActionsEnabled:     true,
	}
	return defaultAlarms
}
func SaveAlarmClass(className string, data []byte) (class AlarmClass, err error) {
	err = json.Unmarshal(data, &class)
	if err != nil {
		return
	}
	err = Insert("alarms", AlarmClasses{className: class})
	return
}