Skip to content

lavagetto/go-victorops

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-victorops

A VictorOps client for golang.

Installation

go get "github.com/lavagetto/go-victorops/victorops"

Important Note

This client is used to make the API calls that are mentioned here VictorOps public API. However, some features (Rotations and Paging Policies) are not publicly available yet.

Example Usage

package main

import (
	"fmt"

	"github.com/lavagetto/go-victorops/victorops"
)

func main() {

	// Client initialization
	victoropsClient := victorops.NewClient(apiID, apiKey, "https://api.victorops.com")

	// Get all users in an account
	userList, _, err := victoropsClient.GetAllUsers()
	if err != nil {
		panic(err)
	}

	// Create a new victorops team
	team := victorops.Team{
		Name: "Test Team",
	}
	newTeam, details, err := victoropsClient.CreateTeam(&team)
	if err != nil {
		panic(err)
	}

	if details.StatusCode != 200 {
		panic(fmt.Errorf("failed to create team (%d): %s", details.StatusCode, details.ResponseBody))
	}

	fmt.Printf("Created team: %s\n", newTeam.Name)
}

About

A Golang SDK for the VictorOps API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 98.7%
  • Makefile 1.3%