Skip to content

circonus-labs/go-apiclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Circonus API Client Go package

Full documentation (for using this package) is available at godoc.org. Links in the lists below go directly to the generic Circonus API documentation for the endpoint.

NOTE: This package is a replacement for github.com/circonus-labs/circonus-gometrics/api (which should now be considered DEPRECATED)

Examples

There are rudimentary examples in the examples directory for basic Fetch* calls.

Configuration

  • Config.TokenKey required Circonus API Token key
  • Config.TokenApp Circonus API Token application name (default: circonus-goapiclient)
  • Config.URL the Circonus API URL (default: https://api.circonus.com/v2)
  • Config.TLSConfig a *tls.Config for contacting the API URL when it is not using a public SSL certificate (default: none)
  • Config.Log a *log.Logger instance where log messages should be sent (default: discard log messages)
  • Config.Debug turn on debugging messages (default: false)

Minimal example:

package main

import (
    "fmt"

    api "github.com/circonus-labs/go-apiclient"
)

func main() {
    client, err := api.New(&api.Config{TokenKey: "..."})
    if err != nil {
        panic(err)
    }
    user, err := client.FetchUser(nil)    
    if err != nil {
        panic(err)
    }
    fmt.Printf("%#v\n", user)
}

Straight [raw] API access

  • Get
  • Post (for creates)
  • Put (for updates)
  • Delete

Helpers for currently supported API endpoints

Note, these interfaces are still being actively developed. For example, many of the New* methods only return an empty struct; sensible defaults will be added going forward. Other, common helper methods for the various endpoints may be added as use cases emerge. The organization of the API may change if common use contexts would benefit significantly.

  • Account
    • FetchAccount
    • FetchAccounts
    • UpdateAccount
    • SearchAccounts
  • Acknowledgement
    • NewAcknowledgement
    • FetchAcknowledgement
    • FetchAcknowledgements
    • UpdateAcknowledgement
    • CreateAcknowledgement
    • DeleteAcknowledgement
    • DeleteAcknowledgementByCID
    • SearchAcknowledgements
  • Alert
    • FetchAlert
    • FetchAlerts
    • SearchAlerts
  • Annotation
    • NewAnnotation
    • FetchAnnotation
    • FetchAnnotations
    • UpdateAnnotation
    • CreateAnnotation
    • DeleteAnnotation
    • DeleteAnnotationByCID
    • SearchAnnotations
  • Broker
    • FetchBroker
    • FetchBrokers
    • SearchBrokers
  • Check Bundle
    • NewCheckBundle
    • FetchCheckBundle
    • FetchCheckBundles
    • UpdateCheckBundle
    • CreateCheckBundle
    • DeleteCheckBundle
    • DeleteCheckBundleByCID
    • SearchCheckBundles
  • Check Bundle Metrics
    • FetchCheckBundleMetrics
    • UpdateCheckBundleMetrics
  • Check
    • FetchCheck
    • FetchChecks
    • SearchChecks
  • Contact Group
    • NewContactGroup
    • FetchContactGroup
    • FetchContactGroups
    • UpdateContactGroup
    • CreateContactGroup
    • DeleteContactGroup
    • DeleteContactGroupByCID
    • SearchContactGroups
  • Dashboard -- note, this is a work in progress, the methods/types may still change
    • NewDashboard
    • FetchDashboard
    • FetchDashboards
    • UpdateDashboard
    • CreateDashboard
    • DeleteDashboard
    • DeleteDashboardByCID
    • SearchDashboards
  • Graph
    • NewGraph
    • FetchGraph
    • FetchGraphs
    • UpdateGraph
    • CreateGraph
    • DeleteGraph
    • DeleteGraphByCID
    • SearchGraphs
  • Metric Cluster
    • NewMetricCluster
    • FetchMetricCluster
    • FetchMetricClusters
    • UpdateMetricCluster
    • CreateMetricCluster
    • DeleteMetricCluster
    • DeleteMetricClusterByCID
    • SearchMetricClusters
  • Metric
    • FetchMetric
    • FetchMetrics
    • UpdateMetric
    • SearchMetrics
  • Maintenance window
    • NewMaintenanceWindow
    • FetchMaintenanceWindow
    • FetchMaintenanceWindows
    • UpdateMaintenanceWindow
    • CreateMaintenanceWindow
    • DeleteMaintenanceWindow
    • DeleteMaintenanceWindowByCID
    • SearchMaintenanceWindows
  • Outlier Report
    • NewOutlierReport
    • FetchOutlierReport
    • FetchOutlierReports
    • UpdateOutlierReport
    • CreateOutlierReport
    • DeleteOutlierReport
    • DeleteOutlierReportByCID
    • SearchOutlierReports
  • Provision Broker
    • NewProvisionBroker
    • FetchProvisionBroker
    • UpdateProvisionBroker
    • CreateProvisionBroker
  • Rule Set
    • NewRuleset
    • FetchRuleset
    • FetchRulesets
    • UpdateRuleset
    • CreateRuleset
    • DeleteRuleset
    • DeleteRulesetByCID
    • SearchRulesets
  • Rule Set Group
    • NewRulesetGroup
    • FetchRulesetGroup
    • FetchRulesetGroups
    • UpdateRulesetGroup
    • CreateRulesetGroup
    • DeleteRulesetGroup
    • DeleteRulesetGroupByCID
    • SearchRulesetGroups
  • User
    • FetchUser
    • FetchUsers
    • UpdateUser
    • SearchUsers
  • Worksheet
    • NewWorksheet
    • FetchWorksheet
    • FetchWorksheets
    • UpdateWorksheet
    • CreateWorksheet
    • DeleteWorksheet
    • DeleteWorksheetByCID
    • SearchWorksheets

Unless otherwise noted, the source files are distributed under the BSD-style license found in the LICENSE file.