Skip to content

Anashaikh/test123

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-cag

go-cag is a client library for accessing the CAG API.

For documentation of the CAG API, see https://webhookv3.alerting.monitoring.bskyb.com/api/doc.

Usage

import "github.com/sky-uk/go-cag"

Create a new CAG client.

cagClient := cag.NewClient(
	*cagURL,
	*cagAPIKey,
	*sslSkipVerify,
)

Create an alert.

cagAlert := cagClient.NewAlert(&cag.AlertData{
        MonitoredItem: "test.hostname",
        AlertSummary: "Memory Spike",
        DetailedDescription: "The memory on node: test.hostname has spiked to 150% usage, please check this out",
        AssignTo: "Your Spark Team",
        Severity: "warn",
        HelpURL: "https://your-helpful-docs",
        MonitoringGroup: "My System",
        MonitoringSystem: "My Amazing Client",
})

cagAlertResponse, statusCode, err := cagAlert.Create()
if err != nil {
    fmt.Printf("Failed to create CAG alert, recieved status code \"%i\" and error: %e\n", statusCode, err)
    exit 1
} else {
    fmt.Printf("Created CAG alert: %v\n", cagAlertResponse)
}

Supported Resources

Support for resources is being added as needed.

  • Status
  • Heartbeat
  • History
  • Permissions
  • Submit

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published